From 577da313df0aaf383f5407212ce1b20107dac7ff Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 14 Dec 2021 21:36:00 +0000 Subject: [PATCH] merge bitcoin#23777: follow-ups from bitcoin#23365 --- src/index/base.cpp | 2 ++ test/functional/feature_blockfilterindex_prune.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/index/base.cpp b/src/index/base.cpp index 73783c1a38..5390411432 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -99,6 +99,8 @@ bool BaseIndex::Init() prune_violation = false; break; } + // block->pprev must exist at this point, since block_to_test is part of the chain + // and thus must be encountered when going backwards from the tip assert(block->pprev); block = block->pprev; } diff --git a/test/functional/feature_blockfilterindex_prune.py b/test/functional/feature_blockfilterindex_prune.py index 198df5c50f..361a9cce01 100755 --- a/test/functional/feature_blockfilterindex_prune.py +++ b/test/functional/feature_blockfilterindex_prune.py @@ -30,6 +30,8 @@ class FeatureBlockfilterindexPruneTest(BitcoinTestFramework): self.log.info("prune some blocks") pruneheight = self.nodes[0].pruneblockchain(400) + # the prune heights used here and below are magic numbers that are determined by the + # thresholds at which block files wrap, so they depend on disk serialization and default block file size. assert_equal(pruneheight, 366) self.log.info("check if we can access the tips blockfilter when we have pruned some blocks")