core/filtermaps: polish

This commit is contained in:
Gary Rong 2025-04-30 11:19:58 +08:00
parent 73b1ff2cd4
commit 7c59af1044

View file

@ -103,6 +103,7 @@ func (cv *ChainView) Receipts(number uint64) types.Receipts {
blockHash := cv.BlockHash(number)
if blockHash == (common.Hash{}) {
log.Error("Chain view: block hash unavailable", "number", number, "head", cv.headNumber)
return nil
}
return cv.chain.GetReceiptsByHash(blockHash)
}
@ -114,6 +115,7 @@ func (cv *ChainView) RawReceipts(number uint64) types.Receipts {
blockHash := cv.BlockHash(number)
if blockHash == (common.Hash{}) {
log.Error("Chain view: block hash unavailable", "number", number, "head", cv.headNumber)
return nil
}
return cv.chain.GetRawReceiptsByHash(blockHash)
}