wallet, test: fix sendall anti-fee-sniping when locktime is not specified

This particular test case only needs to ensure that locktime is not
specified in the RPC request, it doesn't need to rely on the wallet optin
RBF default that causes the test to pass coincidentally.

Co-authored-by: maflcko <6399679+maflcko@users.noreply.github.com>
This commit is contained in:
rkrux
2026-05-28 19:41:58 +05:30
parent 8877eec726
commit 9c1fcaca5c

View File

@@ -59,8 +59,8 @@ class SendallTest(BitcoinTestFramework):
return self.wallet.getbalances()["mine"]["trusted"] return self.wallet.getbalances()["mine"]["trusted"]
# Helper schema for success cases # Helper schema for success cases
def test_sendall_success(self, sendall_args, remaining_balance = 0): def test_sendall_success(self, sendall_args, remaining_balance = 0, *, options=None):
sendall_tx_receipt = self.wallet.sendall(sendall_args) sendall_tx_receipt = self.wallet.sendall(sendall_args, options=options)
self.generate(self.nodes[0], 1) self.generate(self.nodes[0], 1)
# wallet has remaining balance (usually empty) # wallet has remaining balance (usually empty)
assert_equal(remaining_balance, self.wallet.getbalances()["mine"]["trusted"]) assert_equal(remaining_balance, self.wallet.getbalances()["mine"]["trusted"])
@@ -436,7 +436,7 @@ class SendallTest(BitcoinTestFramework):
def sendall_anti_fee_sniping(self): def sendall_anti_fee_sniping(self):
self.log.info("Testing sendall does anti-fee-sniping when locktime is not specified") self.log.info("Testing sendall does anti-fee-sniping when locktime is not specified")
self.add_utxos([10,11]) 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 # the locktime should be within 100 blocks of the
# block height # block height