HasBlockAndState checks if a block and associated state trie is fully present in the database or not, caching it if present.
(hash common.Hash, number uint64)
| 699 | // HasBlockAndState checks if a block and associated state trie is fully present |
| 700 | // in the database or not, caching it if present. |
| 701 | func (bc *BlockChain) HasBlockAndState(hash common.Hash, number uint64) bool { |
| 702 | // Check first that the block itself is known |
| 703 | block := bc.GetBlock(hash, number) |
| 704 | if block == nil { |
| 705 | return false |
| 706 | } |
| 707 | return bc.HasState(block.StateRoot()) |
| 708 | } |
| 709 | |
| 710 | // GetBlock retrieves a block from the database by hash and number, |
| 711 | // caching it if found. |
no test coverage detected