Skip to content

Commit e3a0e34

Browse files
committed
core/rawdb: simplify condition
1 parent d2591a7 commit e3a0e34

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: core/rawdb/chain_iterator.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,8 @@ func unindexTransactionsForTesting(db ethdb.Database, from uint64, to uint64, in
367367
// PruneTransactionIndex removes all tx index entries below a certain block number.
368368
func PruneTransactionIndex(db ethdb.Database, pruneBlock uint64) {
369369
tail := ReadTxIndexTail(db)
370-
if tail == nil {
371-
return // no index
372-
}
373-
if *tail > pruneBlock {
374-
return // index ends above pruneBlock
370+
if tail == nil || *tail > pruneBlock {
371+
return // no index, or index ends above pruneBlock
375372
}
376373

377374
// There are blocks below pruneBlock in the index. Iterate the entire index to remove

0 commit comments

Comments
 (0)