What changed, and why it matters
This is a code-quality cleanup, not a security fix. It changes two test-only comparisons from '== False' to 'is False' and removes a linter exception. The commit message says this preserves RPC semantics, but the change is inside Bitcoin's own functional test suite and does not alter the production Bitcoin node software that users run.
No security action needed. Treat as a normal lint/test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes the E712 (‘true-false comparison’) ignore from ruff.toml and updates two assertions in test/functional/feature_pruning.py. The assertions wait for wallet scanning to finish by checking getwalletinfo()[‘scanning’] is False. The change is purely in test code; no consensus, networking, wallet, or RPC server code is modified. The ‘preserve RPC semantics’ note in the commit message refers to avoiding accidental coercion when comparing RPC-returned booleans in tests, not to a runtime behavior change.
Changed components
test/functional/feature_pruning.pyruff.tomlInspect captured patch +2 / −3
diff --git a/ruff.toml b/ruff.toml
index d379dde1..a252c2f4 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -12,7 +12,6 @@ select = [
]
ignore = [
"E501", # line too long
- "E712", # true-false comparison
"E731", # lambda assignment
"E741", # ambiguous-variable-name
]
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 4a0b3346..0a8f8e44 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -350,14 +350,14 @@ class PruneTest(BitcoinTestFramework):
self.log.info("Stop and start pruning node to trigger wallet rescan")
self.restart_node(2, extra_args=["-prune=550"])
- self.wait_until(lambda: self.nodes[2].getwalletinfo()["scanning"] == False)
+ self.wait_until(lambda: self.nodes[2].getwalletinfo()["scanning"] is False)
self.wait_until(lambda: self.nodes[2].getwalletinfo()["lastprocessedblock"]["height"] == self.nodes[2].getblockcount())
# check that wallet loads successfully when restarting a pruned node after IBD.
# this was reported to fail in #7494.
self.restart_node(5, extra_args=["-prune=550", "-blockfilterindex=1"]) # restart to trigger rescan
- self.wait_until(lambda: self.nodes[5].getwalletinfo()["scanning"] == False)
+ self.wait_until(lambda: self.nodes[5].getwalletinfo()["scanning"] is False)
self.wait_until(lambda: self.nodes[5].getwalletinfo()["lastprocessedblock"]["height"] == self.nodes[0].getblockcount())
def run_test(self):
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.