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

Method HasBlock

core/blockchain.go:686–691  ·  view source on GitHub ↗

HasBlock checks if a block is fully present in the database or not.

(hash common.Hash, number uint64)

Source from the content-addressed store, hash-verified

684
685// HasBlock checks if a block is fully present in the database or not.
686func (bc *BlockChain) HasBlock(hash common.Hash, number uint64) bool {
687 if bc.blockCache.Contains(hash) {
688 return true
689 }
690 return rawdb.HasBody(bc.db, hash, number)
691}
692
693// HasState checks if state trie is fully present in the database or not.
694func (bc *BlockChain) HasState(hash common.Hash) bool {

Callers 1

InsertReceiptChainMethod · 0.95

Calls 1

ContainsMethod · 0.65

Tested by

no test coverage detected