Set fullTx option in constructor

This commit is contained in:
Taylor Gerring
2015-04-01 13:18:30 +02:00
parent dba9b83aa0
commit 88f2a96ca3
3 changed files with 17 additions and 19 deletions

View File

@ -29,12 +29,15 @@ type BlockRes struct {
Uncles []*hexdata `json:"uncles"`
}
func NewBlockRes(block *types.Block) *BlockRes {
func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
// TODO respect fullTx flag
if block == nil {
return &BlockRes{}
}
res := new(BlockRes)
res.fullTx = fullTx
res.BlockNumber = newHexNum(block.Number())
res.BlockHash = newHexData(block.Hash())
res.ParentHash = newHexData(block.ParentHash())