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

Method SetKnownHead

core/blockchain.go:318–325  ·  view source on GitHub ↗

SetKnownHead sets the known head block hash and number

(hash common.Hash, number uint64)

Source from the content-addressed store, hash-verified

316
317// SetKnownHead sets the known head block hash and number
318func (bc *BlockChain) SetKnownHead(hash common.Hash, number uint64) {
319 bc.knownHeadLock.Lock()
320 defer bc.knownHeadLock.Unlock()
321
322 if number > bc.knownHeadNumber {
323 bc.knownHeadHash, bc.knownHeadNumber = hash, number
324 }
325}
326
327// loadLastState loads the last known chain state from the database. This method
328// assumes that the chain manager mutex is held.

Callers 2

NewBlockChainFunction · 0.95
insertChainMethod · 0.95

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected