diff options
author | Jhih-Ming Huang <jm@byzantine-lab.io> | 2019-10-17 15:49:20 +0800 |
---|---|---|
committer | Jhih-Ming Huang <jm@byzantine-lab.io> | 2019-10-17 18:39:35 +0800 |
commit | 5d4fe10fdb7c8095bd65bc86faa748f32c84a67c (patch) | |
tree | 9bbe34f179f355fd6703c6d6e6a013e1bfd1e814 | |
parent | e4888a814bb746037b98f68595191c0aa2aff95b (diff) | |
download | go-tangerine-5d4fe10fdb7c8095bd65bc86faa748f32c84a67c.tar.gz go-tangerine-5d4fe10fdb7c8095bd65bc86faa748f32c84a67c.tar.zst go-tangerine-5d4fe10fdb7c8095bd65bc86faa748f32c84a67c.zip |
add log for get receipts
-rw-r--r-- | core/blockchain.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 76d490d65..42caf4edd 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -699,14 +699,19 @@ func (bc *BlockChain) GetBlockByNumber(number uint64) *types.Block { // GetReceiptsByHash retrieves the receipts for all transactions in a given block. func (bc *BlockChain) GetReceiptsByHash(hash common.Hash) types.Receipts { + logger := log.New("!!!!!!!!!GetReceiptsByHash", "") + logger.Info("in the function body") if receipts, ok := bc.receiptsCache.Get(hash); ok { + logger.Info("GetReceiptsByHash cache hit", "len(receipts)", len(receipts.(types.Receipts))) return receipts.(types.Receipts) } number := rawdb.ReadHeaderNumber(bc.db, hash) if number == nil { + logger.Info("number == nil") return nil } receipts := rawdb.ReadReceipts(bc.db, hash, *number) + logger.Info("len(receipts)", "len(receipts)", len(receipts)) bc.receiptsCache.Add(hash, receipts) return receipts } |