mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
fix: delete txlookup for txns in body on rewind
This commit is contained in:
parent
27b3a6087e
commit
4d6c3c2dcb
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue