From ec526af8d1b6dde18d3f376fbb2e1a2d9ae4892c Mon Sep 17 00:00:00 2001 From: silence Date: Tue, 15 Jan 2019 14:34:13 +0800 Subject: [PATCH] Update blockchain.go receipts may be null for very short time in some condition. For this case, we should not add the null value into cache. Because you will not get the right result if you keep requesting that receipt. --- core/blockchain.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index c719883ee5..156efe303a 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -644,6 +644,9 @@ func (bc *BlockChain) GetReceiptsByHash(hash common.Hash) types.Receipts { return nil } receipts := rawdb.ReadReceipts(bc.db, hash, *number) + if receipts == nil { + return nil + } bc.receiptsCache.Add(hash, receipts) return receipts }