diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-10-14 11:47:09 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-11-09 09:12:53 +0800 |
commit | 760fd65487614b7a61443cd9371015925795f40f (patch) | |
tree | a2b122f03b7782e729be85b136f4c5304a164c9e /core/types | |
parent | 8b1df1a259fe6dc4c15e391e9c0762c9621d9d72 (diff) | |
download | dexon-760fd65487614b7a61443cd9371015925795f40f.tar dexon-760fd65487614b7a61443cd9371015925795f40f.tar.gz dexon-760fd65487614b7a61443cd9371015925795f40f.tar.bz2 dexon-760fd65487614b7a61443cd9371015925795f40f.tar.lz dexon-760fd65487614b7a61443cd9371015925795f40f.tar.xz dexon-760fd65487614b7a61443cd9371015925795f40f.tar.zst dexon-760fd65487614b7a61443cd9371015925795f40f.zip |
light: light chain, VM env and tx pool
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/block.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/types/block.go b/core/types/block.go index fedcfdbbe..4accb0ee3 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -116,6 +116,15 @@ type jsonHeader struct { Nonce *BlockNonce `json:"nonce"` } +func (h *Header) GetNumber() *big.Int { return new(big.Int).Set(h.Number) } +func (h *Header) GetGasLimit() *big.Int { return new(big.Int).Set(h.GasLimit) } +func (h *Header) GetGasUsed() *big.Int { return new(big.Int).Set(h.GasUsed) } +func (h *Header) GetDifficulty() *big.Int { return new(big.Int).Set(h.Difficulty) } +func (h *Header) GetTime() *big.Int { return new(big.Int).Set(h.Time) } +func (h *Header) GetNumberU64() uint64 { return h.Number.Uint64() } +func (h *Header) GetNonce() uint64 { return binary.BigEndian.Uint64(h.Nonce[:]) } +func (h *Header) GetExtra() []byte { return common.CopyBytes(h.Extra) } + // Hash returns the block hash of the header, which is simply the keccak256 hash of its // RLP encoding. func (h *Header) Hash() common.Hash { |