HasBlock checks if a block is fully present in the database or not.
(hash common.Hash, number uint64)
| 684 | |
| 685 | // HasBlock checks if a block is fully present in the database or not. |
| 686 | func (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. |
| 694 | func (bc *BlockChain) HasState(hash common.Hash) bool { |
no test coverage detected