mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
cmd/geth: use PruneTransactionIndex
This commit is contained in:
parent
2e470f1865
commit
403e64ce75
1 changed files with 1 additions and 7 deletions
|
|
@ -647,8 +647,6 @@ func pruneHistory(ctx *cli.Context) error {
|
||||||
return fmt.Errorf("merge block hash mismatch: got %s, want %s", hash.Hex(), mergeBlockHash)
|
return fmt.Errorf("merge block hash mismatch: got %s, want %s", hash.Hex(), mergeBlockHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
txlookupTail := rawdb.ReadTxIndexTail(chaindb)
|
|
||||||
|
|
||||||
log.Info("Starting chain pruning",
|
log.Info("Starting chain pruning",
|
||||||
"currentHeight", currentHeader.Number,
|
"currentHeight", currentHeader.Number,
|
||||||
"mergeBlock", mergeBlock,
|
"mergeBlock", mergeBlock,
|
||||||
|
|
@ -656,11 +654,7 @@ func pruneHistory(ctx *cli.Context) error {
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
// First prune the transaction lookup index as
|
rawdb.PruneTransactionIndex(chaindb, mergeBlock)
|
||||||
// it requires the block bodies.
|
|
||||||
if txlookupTail != nil && *txlookupTail < mergeBlock {
|
|
||||||
rawdb.UnindexTransactions(chaindb, *txlookupTail, mergeBlock, nil, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(s1na): what if there is a crash between the two prune operations?
|
// TODO(s1na): what if there is a crash between the two prune operations?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue