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

Method SetCurrentHeader

core/headerchain.go:398–403  ·  view source on GitHub ↗

SetCurrentHeader sets the current head header of the canonical chain.

(head *types.Header)

Source from the content-addressed store, hash-verified

396
397// SetCurrentHeader sets the current head header of the canonical chain.
398func (hc *HeaderChain) SetCurrentHeader(head *types.Header) {
399 rawdb.WriteHeadHeaderHash(hc.chainDb, head.Hash())
400
401 hc.currentHeader.Store(head)
402 hc.currentHeaderHash = head.Hash()
403}
404
405// DeleteCallback is a callback function that is called by SetHead before
406// each header is deleted.

Callers 4

loadLastStateMethod · 0.80
ResetWithGenesisBlockMethod · 0.80
insertMethod · 0.80
RollbackMethod · 0.80

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected