aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/parsing.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-09-08 01:43:01 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-09-11 22:42:25 +0800
commitcdc2662c4098d68a7b450b9b9ff2688acbffcee4 (patch)
tree2dfb3b7365895203132bd6d1aa650b5a239b01eb /rpc/api/parsing.go
parent2b339cbbd8bb475d2195d54a71dcced700003430 (diff)
downloaddexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.gz
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.zst
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.zip
core: split out TD from database and all internals
Diffstat (limited to 'rpc/api/parsing.go')
-rw-r--r--rpc/api/parsing.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go
index 5858bc136..cdfaa0ed1 100644
--- a/rpc/api/parsing.go
+++ b/rpc/api/parsing.go
@@ -281,7 +281,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
}
}
-func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
+func NewBlockRes(block *types.Block, td *big.Int, fullTx bool) *BlockRes {
if block == nil {
return nil
}
@@ -299,7 +299,7 @@ func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
res.ReceiptRoot = newHexData(block.ReceiptHash())
res.Miner = newHexData(block.Coinbase())
res.Difficulty = newHexNum(block.Difficulty())
- res.TotalDifficulty = newHexNum(block.Td)
+ res.TotalDifficulty = newHexNum(td)
res.Size = newHexNum(block.Size().Int64())
res.ExtraData = newHexData(block.Extra())
res.GasLimit = newHexNum(block.GasLimit())