diff --git a/core/blockchain.go b/core/blockchain.go index 858eceb630..dbc8bcfada 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1075,10 +1075,16 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, time uint64, root common.Ha // Remove the associated body and receipts from the key-value store. // The header, hash-to-number mapping, and canonical hash will be // removed by the hc.SetHead function. + if body := rawdb.ReadBody(bc.db, hash, num); body != nil { + for _, tx := range body.Transactions { + + rawdb.DeleteTxLookupEntry(db, tx.Hash()) + } + } + rawdb.DeleteBody(db, hash, num) rawdb.DeleteReceipts(db, hash, num) } - // Todo(rjl493456442) txlookup, log index, etc } // If SetHead was only called as a chain reparation method, try to skip // touching the header chain altogether, unless the freezer is broken