GetBlockByHash retrieves a block from the database by hash, caching it if found.
(hash common.Hash)
| 725 | |
| 726 | // GetBlockByHash retrieves a block from the database by hash, caching it if found. |
| 727 | func (bc *BlockChain) GetBlockByHash(hash common.Hash) *types.Block { |
| 728 | number := bc.hc.GetBlockNumber(hash) |
| 729 | if number == nil { |
| 730 | return nil |
| 731 | } |
| 732 | return bc.GetBlock(hash, *number) |
| 733 | } |
| 734 | |
| 735 | // GetBlockByNumber retrieves a block from the database by number, caching it |
| 736 | // (associated with its hash) if found. |
no test coverage detected