mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-20 14:59:26 +00:00
Length checking when fetching contract. Contract always have 3 fields
This commit is contained in:
parent
4f4175a3e2
commit
507fc7b9d1
1 changed files with 5 additions and 0 deletions
|
|
@ -131,6 +131,11 @@ func (block *Block) GetContract(addr []byte) *Contract {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value := ethutil.NewValueFromBytes([]byte(data))
|
||||||
|
if value.Len() == 2 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
contract := &Contract{}
|
contract := &Contract{}
|
||||||
contract.RlpDecode([]byte(data))
|
contract.RlpDecode([]byte(data))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue