Add ExtraData field to RPC output

This commit is contained in:
Taylor Gerring 2015-03-29 12:08:52 +02:00
parent eb79938060
commit 391d79ef44

View File

@ -70,7 +70,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext.Difficulty = common.ToHex(b.Difficulty.Bytes()) ext.Difficulty = common.ToHex(b.Difficulty.Bytes())
ext.TotalDifficulty = common.ToHex(b.TotalDifficulty.Bytes()) ext.TotalDifficulty = common.ToHex(b.TotalDifficulty.Bytes())
ext.Size = common.ToHex(b.Size.Bytes()) ext.Size = common.ToHex(b.Size.Bytes())
// ext.ExtraData = common.ToHex(b.ExtraData) ext.ExtraData = common.ToHex(b.ExtraData)
ext.GasLimit = common.ToHex(b.GasLimit.Bytes()) ext.GasLimit = common.ToHex(b.GasLimit.Bytes())
// ext.MinGasPrice = common.ToHex(big.NewInt(b.MinGasPrice).Bytes()) // ext.MinGasPrice = common.ToHex(big.NewInt(b.MinGasPrice).Bytes())
ext.GasUsed = common.ToHex(b.GasUsed.Bytes()) ext.GasUsed = common.ToHex(b.GasUsed.Bytes())
@ -111,7 +111,7 @@ func NewBlockRes(block *types.Block) *BlockRes {
res.Difficulty = block.Difficulty() res.Difficulty = block.Difficulty()
res.TotalDifficulty = block.Td res.TotalDifficulty = block.Td
res.Size = big.NewInt(int64(block.Size())) res.Size = big.NewInt(int64(block.Size()))
// res.ExtraData = res.ExtraData = []byte(block.Header().Extra)
res.GasLimit = block.GasLimit() res.GasLimit = block.GasLimit()
// res.MinGasPrice = // res.MinGasPrice =
res.GasUsed = block.GasUsed() res.GasUsed = block.GasUsed()