HasHeader checks if a block header is present in the database or not.
(hash common.Hash, number uint64)
| 367 | |
| 368 | // HasHeader checks if a block header is present in the database or not. |
| 369 | func (hc *HeaderChain) HasHeader(hash common.Hash, number uint64) bool { |
| 370 | if hc.numberCache.Contains(hash) || hc.headerCache.Contains(hash) { |
| 371 | return true |
| 372 | } |
| 373 | return rawdb.HasHeader(hc.chainDb, hash, number) |
| 374 | } |
| 375 | |
| 376 | // GetHeaderByNumber retrieves a block header from the database by number, |
| 377 | // caching it (associated with its hash) if found. |
no test coverage detected