Skip to content

Commit

Permalink
blockchain: return meta in get block (ethereum#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes authored Oct 23, 2020
1 parent 29f199f commit e2c3c27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,11 @@ func (bc *BlockChain) GetBlock(hash common.Hash, number uint64) *types.Block {
if block == nil {
return nil
}
// Get the transaction meta and attach it to each transaction
for _, tx := range block.Transactions() {
meta := rawdb.ReadTransactionMeta(bc.db, tx.Hash())
tx.SetTransactionMeta(meta)
}
// Cache the found block for next time and return
bc.blockCache.Add(block.Hash(), block)
return block
Expand Down

0 comments on commit e2c3c27

Please sign in to comment.