From 36e58796479290f7846422d1e1e477a630360b99 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 19 Mar 2025 09:09:08 +0100 Subject: [PATCH] core/rawdb: simplify condition --- core/rawdb/chain_iterator.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/rawdb/chain_iterator.go b/core/rawdb/chain_iterator.go index 85ebfbb234..3371669eab 100644 --- a/core/rawdb/chain_iterator.go +++ b/core/rawdb/chain_iterator.go @@ -367,11 +367,8 @@ func unindexTransactionsForTesting(db ethdb.Database, from uint64, to uint64, in // PruneTransactionIndex removes all tx index entries below a certain block number. func PruneTransactionIndex(db ethdb.Database, pruneBlock uint64) { tail := ReadTxIndexTail(db) - if tail == nil { - return // no index - } - if *tail > pruneBlock { - return // index ends above pruneBlock + if tail == nil || *tail > pruneBlock { + return // no index, or index ends above pruneBlock } // There are blocks below pruneBlock in the index. Iterate the entire index to remove