MCPcopy Create free account
hub / github.com/CPChain/chain / GetHeaderByNumber

Method GetHeaderByNumber

core/blockchain.go:1914–1916  ·  view source on GitHub ↗

GetHeaderByNumber retrieves a block header from the database by number, caching it (associated with its hash) if found.

(number uint64)

Source from the content-addressed store, hash-verified

1912// GetHeaderByNumber retrieves a block header from the database by number,
1913// caching it (associated with its hash) if found.
1914func (bc *BlockChain) GetHeaderByNumber(number uint64) *types.Header {
1915 return bc.hc.GetHeaderByNumber(number)
1916}
1917
1918// Config retrieves the blockchain's chain configuration.
1919func (bc *BlockChain) Config() *configs.ChainConfig { return bc.chainConfig }

Callers 3

benchReadChainFunction · 0.95
NewBlockChainFunction · 0.95
WriteBlockWithStateMethod · 0.95

Calls 1

GetHeaderByNumberMethod · 0.65

Tested by 1

benchReadChainFunction · 0.76