diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-25 18:21:35 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-25 18:21:35 +0800 |
commit | 507fc7b9d1e227de91b25e18891c4cd44452b222 (patch) | |
tree | 895a39d4aa0b5b255a3f15db032ca5b70b4774fb | |
parent | 4f4175a3e295272025d312c800f65fc1a143a9ca (diff) | |
download | go-tangerine-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.gz go-tangerine-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.zst go-tangerine-507fc7b9d1e227de91b25e18891c4cd44452b222.zip |
Length checking when fetching contract. Contract always have 3 fields
-rw-r--r-- | ethchain/block.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index 472ae134a..7ca44a47d 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -131,6 +131,11 @@ func (block *Block) GetContract(addr []byte) *Contract { return nil } + value := ethutil.NewValueFromBytes([]byte(data)) + if value.Len() == 2 { + return nil + } + contract := &Contract{} contract.RlpDecode([]byte(data)) |