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

Method CurrentHeader

core/headerchain.go:388–390  ·  view source on GitHub ↗

CurrentHeader retrieves the current head header of the canonical chain. The header is retrieved from the HeaderChain's internal cache.

()

Source from the content-addressed store, hash-verified

386// CurrentHeader retrieves the current head header of the canonical chain. The
387// header is retrieved from the HeaderChain's internal cache.
388func (hc *HeaderChain) CurrentHeader() *types.Header {
389 return hc.currentHeader.Load().(*types.Header)
390}
391
392// CurrentBlock returns nil!
393func (hc *HeaderChain) CurrentBlock() *types.Block {

Callers 3

NewHeaderChainFunction · 0.95
WriteHeaderMethod · 0.95
SetHeadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected