aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-25 18:21:35 +0800
committerobscuren <geffobscura@gmail.com>2014-02-25 18:21:35 +0800
commit507fc7b9d1e227de91b25e18891c4cd44452b222 (patch)
tree895a39d4aa0b5b255a3f15db032ca5b70b4774fb /ethchain
parent4f4175a3e295272025d312c800f65fc1a143a9ca (diff)
downloaddexon-507fc7b9d1e227de91b25e18891c4cd44452b222.tar
dexon-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.gz
dexon-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.bz2
dexon-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.lz
dexon-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.xz
dexon-507fc7b9d1e227de91b25e18891c4cd44452b222.tar.zst
dexon-507fc7b9d1e227de91b25e18891c4cd44452b222.zip
Length checking when fetching contract. Contract always have 3 fields
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block.go5
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))