Merge bitcoin/bitcoin#28944: wallet, rpc: add anti-fee-sniping to send and sendall

aac0b6dd79 test: test sendall and send do anti-fee-sniping (ishaanam)
20802c7b65 wallet, rpc: add anti-fee-sniping to `send` and `sendall` (ishaanam)

Pull request description:

  Currently, `send` and `sendall` don't do anti-fee-sniping because they don't use `CreateTransaction`. This PR adds anti-fee-sniping to these RPCs by calling `DiscourageFeeSniping` from `FinishTransaction` when the user does not specify a locktime.

ACKs for top commit:
  achow101:
    ACK aac0b6dd79
  murchandamus:
    ACK aac0b6dd79
  glozow:
    ACK aac0b6dd79

Tree-SHA512: d4f1b43b5bda489bdba46b0af60e50bff0de604a35670e6ea6e1de2b539f16b3f68805492f51d6d2078d421b63432ca22a561a5721d1a37686f2e48284e1e646
This commit is contained in:
merge-script
2025-07-29 12:07:08 -04:00
6 changed files with 55 additions and 10 deletions

View File

@@ -144,7 +144,12 @@ class WalletSendTest(BitcoinTestFramework):
return
if locktime:
assert_equal(from_wallet.gettransaction(txid=res["txid"], verbose=True)["decoded"]["locktime"], locktime)
return res
else:
if add_to_wallet:
decoded_tx = from_wallet.gettransaction(txid=res["txid"], verbose=True)["decoded"]
assert_greater_than(decoded_tx["locktime"], from_wallet.getblockcount() - 100)
if expect_sign:
assert_equal(res["complete"], True)