From e2c3c27aa3c5288249964f7aa2419d557cd56ceb Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Fri, 23 Oct 2020 11:50:20 -0700 Subject: [PATCH] blockchain: return meta in get block (#61) --- core/blockchain.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index 5daaa371f8dd..492685de9f3f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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