wallet, test: fix sendall anti-fee-sniping when locktime is not specified
What changed, and why it matters
This commit only changes a test file. It makes a wallet functional test more explicit by passing replaceable=False so the test reliably checks anti-fee-sniping locktime behavior, instead of relying on a coincidental wallet default. There is no change to production wallet or node code, so it does not fix a live security vulnerability.
No action required; this is a test-quality improvement. Reviewers may optionally verify that the existing production sendall implementation correctly applies anti-fee-sniping locktime regardless of RBF settings.
Security signals we found
No production code changed
Test-only hardening/refactoring
Anti-fee-sniping behavior is already present; test made deterministic
Evidence from the diff
The diff modifies test/functional/wallet_sendall.py. It adds an options parameter to test_sendall_success and passes options={“replaceable”:False} in sendall_anti_fee_sniping. The goal is to ensure the test verifies that sendall sets an anti-fee-sniping locktime when no locktime is specified, independent of the wallet’s RBF/opt-in default. No consensus, P2P, RPC, or wallet transaction-creation logic is changed.
Changed components
test/functional/wallet_sendall.pyInspect captured patch +3 / −3
diff --git a/test/functional/wallet_sendall.py b/test/functional/wallet_sendall.py
index 0524b5c8..657cdace 100755
--- a/test/functional/wallet_sendall.py
+++ b/test/functional/wallet_sendall.py
@@ -59,8 +59,8 @@ class SendallTest(BitcoinTestFramework):
return self.wallet.getbalances()["mine"]["trusted"]
# Helper schema for success cases
- def test_sendall_success(self, sendall_args, remaining_balance = 0):
- sendall_tx_receipt = self.wallet.sendall(sendall_args)
+ def test_sendall_success(self, sendall_args, remaining_balance = 0, *, options=None):
+ sendall_tx_receipt = self.wallet.sendall(sendall_args, options=options)
self.generate(self.nodes[0], 1)
# wallet has remaining balance (usually empty)
assert_equal(remaining_balance, self.wallet.getbalances()["mine"]["trusted"])
@@ -436,7 +436,7 @@ class SendallTest(BitcoinTestFramework):
def sendall_anti_fee_sniping(self):
self.log.info("Testing sendall does anti-fee-sniping when locktime is not specified")
self.add_utxos([10,11])
- tx_from_wallet = self.test_sendall_success(sendall_args = [self.remainder_target])
+ tx_from_wallet = self.test_sendall_success(sendall_args = [self.remainder_target], options={"replaceable":False})
# the locktime should be within 100 blocks of the
# block height
Why this scored 12/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.