Length checking when fetching contract. Contract always have 3 fields

This commit is contained in:
obscuren 2014-02-25 11:21:35 +01:00
parent 4f4175a3e2
commit 507fc7b9d1

View File

@ -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))