test: fix feature_pruning when built without wallet
What changed, and why it matters
This is a minor test-only fix. It moves a block-syncing step so that a wallet-related test only runs when the wallet feature is actually compiled in. There is no change to Bitcoin Core's production code, no security bug, and no user impact.
No security action needed. This is a routine test maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/feature_pruning.py. Previously the test synced node 5 to node 0 unconditionally before a wallet rescan test. When Bitcoin Core is built without wallet support, that sync was unnecessary and could cause failures. The patch moves the sync inside the wallet-specific branch (guarded by self.is_wallet_compiled()) so the test passes in no-wallet builds. No consensus, networking, wallet, or node runtime code is changed.
Changed components
test/functional/feature_pruning.pyInspect captured patch +4 / −4
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 2c601b6a..5a56a28d 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -354,10 +354,6 @@ class PruneTest(BitcoinTestFramework):
# check that wallet loads successfully when restarting a pruned node after IBD.
# this was reported to fail in #7494.
- self.log.info("Syncing node 5 to test wallet")
- self.connect_nodes(0, 5)
- nds = [self.nodes[0], self.nodes[5]]
- self.sync_blocks(nds, wait=5, timeout=300)
self.restart_node(5, extra_args=["-prune=550", "-blockfilterindex=1"]) # restart to trigger rescan
self.log.info("Success")
@@ -467,6 +463,10 @@ class PruneTest(BitcoinTestFramework):
self.log.info("Test manual pruning with timestamps")
self.manual_test(4, use_timestamp=True)
+ self.log.info("Syncing node 5 to node 0")
+ self.connect_nodes(0, 5)
+ self.sync_blocks([self.nodes[0], self.nodes[5]], wait=5, timeout=300)
+
if self.is_wallet_compiled():
self.log.info("Test wallet re-scan")
self.wallet_test()
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.