GetHeaderByHash retrieves a block header from the database by hash, caching it if found.
(hash common.Hash)
| 358 | // GetHeaderByHash retrieves a block header from the database by hash, caching it if |
| 359 | // found. |
| 360 | func (hc *HeaderChain) GetHeaderByHash(hash common.Hash) *types.Header { |
| 361 | number := hc.GetBlockNumber(hash) |
| 362 | if number == nil { |
| 363 | return nil |
| 364 | } |
| 365 | return hc.GetHeader(hash, *number) |
| 366 | } |
| 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 { |
no test coverage detected