GetBlockByNumber retrieves a block from the database by number, caching it (associated with its hash) if found.
(number uint64)
| 735 | // GetBlockByNumber retrieves a block from the database by number, caching it |
| 736 | // (associated with its hash) if found. |
| 737 | func (bc *BlockChain) GetBlockByNumber(number uint64) *types.Block { |
| 738 | hash := rawdb.ReadCanonicalHash(bc.db, number) |
| 739 | if hash == (common.Hash{}) { |
| 740 | return nil |
| 741 | } |
| 742 | return bc.GetBlock(hash, number) |
| 743 | } |
| 744 | |
| 745 | // GetReceiptsByHash retrieves the receipts for all transactions in a given block. |
| 746 | func (bc *BlockChain) GetReceiptsByHash(hash common.Hash) types.Receipts { |
no test coverage detected