From 403e64ce75b9395c5c37ac9ea1e416cbfb8781cc Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 18 Mar 2025 16:57:12 +0100 Subject: [PATCH] cmd/geth: use PruneTransactionIndex --- cmd/geth/chaincmd.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index a3e51796d0..9c5e532f21 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -647,8 +647,6 @@ func pruneHistory(ctx *cli.Context) error { return fmt.Errorf("merge block hash mismatch: got %s, want %s", hash.Hex(), mergeBlockHash) } - txlookupTail := rawdb.ReadTxIndexTail(chaindb) - log.Info("Starting chain pruning", "currentHeight", currentHeader.Number, "mergeBlock", mergeBlock, @@ -656,11 +654,7 @@ func pruneHistory(ctx *cli.Context) error { start := time.Now() - // First prune the transaction lookup index as - // it requires the block bodies. - if txlookupTail != nil && *txlookupTail < mergeBlock { - rawdb.UnindexTransactions(chaindb, *txlookupTail, mergeBlock, nil, false) - } + rawdb.PruneTransactionIndex(chaindb, mergeBlock) // TODO(s1na): what if there is a crash between the two prune operations?