diff options
Diffstat (limited to 'core/types/block.go')
-rw-r--r-- | core/types/block.go | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/core/types/block.go b/core/types/block.go index 1d00d9f93..9be62b9e0 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -77,8 +77,8 @@ type Header struct { Bloom Bloom `json:"logsBloom" gencodec:"required"` Difficulty *big.Int `json:"difficulty" gencodec:"required"` Number *big.Int `json:"number" gencodec:"required"` - GasLimit *big.Int `json:"gasLimit" gencodec:"required"` - GasUsed *big.Int `json:"gasUsed" gencodec:"required"` + GasLimit uint64 `json:"gasLimit" gencodec:"required"` + GasUsed uint64 `json:"gasUsed" gencodec:"required"` Time *big.Int `json:"timestamp" gencodec:"required"` Extra []byte `json:"extraData" gencodec:"required"` MixDigest common.Hash `json:"mixHash" gencodec:"required"` @@ -89,8 +89,8 @@ type Header struct { type headerMarshaling struct { Difficulty *hexutil.Big Number *hexutil.Big - GasLimit *hexutil.Big - GasUsed *hexutil.Big + GasLimit *hexutil.Uint64 + GasUsed *hexutil.Uint64 Time *hexutil.Big Extra hexutil.Bytes Hash common.Hash `json:"hash"` // adds call to Hash() in MarshalJSON @@ -243,12 +243,6 @@ func CopyHeader(h *Header) *Header { if cpy.Number = new(big.Int); h.Number != nil { cpy.Number.Set(h.Number) } - if cpy.GasLimit = new(big.Int); h.GasLimit != nil { - cpy.GasLimit.Set(h.GasLimit) - } - if cpy.GasUsed = new(big.Int); h.GasUsed != nil { - cpy.GasUsed.Set(h.GasUsed) - } if len(h.Extra) > 0 { cpy.Extra = make([]byte, len(h.Extra)) copy(cpy.Extra, h.Extra) @@ -302,8 +296,8 @@ func (b *Block) Transaction(hash common.Hash) *Transaction { } func (b *Block) Number() *big.Int { return new(big.Int).Set(b.header.Number) } -func (b *Block) GasLimit() *big.Int { return new(big.Int).Set(b.header.GasLimit) } -func (b *Block) GasUsed() *big.Int { return new(big.Int).Set(b.header.GasUsed) } +func (b *Block) GasLimit() uint64 { return b.header.GasLimit } +func (b *Block) GasUsed() uint64 { return b.header.GasUsed } func (b *Block) Difficulty() *big.Int { return new(big.Int).Set(b.header.Difficulty) } func (b *Block) Time() *big.Int { return new(big.Int).Set(b.header.Time) } |