diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-24 17:39:17 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-24 17:39:17 +0800 |
commit | 57dc435f9b928f5de2a49736a2c71a7bf611289a (patch) | |
tree | 9d6981298eef522382b8c549f190b7204d0dd494 /ethchain/block.go | |
parent | 615d20598ababa5988d5b36a48640c154d8866fd (diff) | |
download | dexon-57dc435f9b928f5de2a49736a2c71a7bf611289a.tar.gz dexon-57dc435f9b928f5de2a49736a2c71a7bf611289a.tar.zst dexon-57dc435f9b928f5de2a49736a2c71a7bf611289a.zip |
Added TD for each block
Diffstat (limited to 'ethchain/block.go')
-rw-r--r-- | ethchain/block.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index 157be2a52..5e8aca33a 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -18,6 +18,7 @@ type BlockInfo struct { Number uint64 Hash []byte Parent []byte + TD *big.Int } func (bi *BlockInfo) RlpDecode(data []byte) { @@ -26,10 +27,11 @@ func (bi *BlockInfo) RlpDecode(data []byte) { bi.Number = decoder.Get(0).Uint() bi.Hash = decoder.Get(1).Bytes() bi.Parent = decoder.Get(2).Bytes() + bi.TD = decoder.Get(3).BigInt() } func (bi *BlockInfo) RlpEncode() []byte { - return ethutil.Encode([]interface{}{bi.Number, bi.Hash, bi.Parent}) + return ethutil.Encode([]interface{}{bi.Number, bi.Hash, bi.Parent, bi.TD}) } type Blocks []*Block |