core: log message if DeriveFields returns error (#27530)

This error will never happen, but if it ever does happen, we will at least see it.
This commit is contained in:
aaronbuchwald 2023-06-27 04:29:19 -04:00 committed by GitHub
parent 900591299f
commit d73eb87979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2048,7 +2048,9 @@ func (bc *BlockChain) recoverAncestors(block *types.Block) (common.Hash, error)
// the processing of a block. These logs are later announced as deleted or reborn.
func (bc *BlockChain) collectLogs(b *types.Block, removed bool) []*types.Log {
receipts := rawdb.ReadRawReceipts(bc.db, b.Hash(), b.NumberU64())
receipts.DeriveFields(bc.chainConfig, b.Hash(), b.NumberU64(), b.Time(), b.BaseFee(), b.Transactions())
if err := receipts.DeriveFields(bc.chainConfig, b.Hash(), b.NumberU64(), b.Time(), b.BaseFee(), b.Transactions()); err != nil {
log.Error("Failed to derive block receipts fields", "hash", b.Hash(), "number", b.NumberU64(), "err", err)
}
var logs []*types.Log
for _, receipt := range receipts {