Skip to content

Commit e4a8d56

Browse files
mzumsandejnewbery
andcommitted
doc: add explanations for assert in index and magic numbers in test
These were suggested in review of #23365 Co-authored-by: John Newbery <[email protected]>
1 parent aaaceb7 commit e4a8d56

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/index/base.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ bool BaseIndex::Init()
9696
prune_violation = false;
9797
break;
9898
}
99+
// block->pprev must exist at this point, since block_to_test is part of the chain
100+
// and thus must be encountered when going backwards from the tip
99101
assert(block->pprev);
100102
block = block->pprev;
101103
}

test/functional/feature_blockfilterindex_prune.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def run_test(self):
2929

3030
self.log.info("prune some blocks")
3131
pruneheight = self.nodes[0].pruneblockchain(400)
32+
# the prune heights used here and below are magic numbers that are determined by the
33+
# thresholds at which block files wrap, so they depend on disk serialization and default block file size.
3234
assert_equal(pruneheight, 248)
3335

3436
self.log.info("check if we can access the tips blockfilter when we have pruned some blocks")

0 commit comments

Comments
 (0)