[wallet] randomly generate change targets

If the wallet always chooses 1 million sats as its change target, it is
easier to fingerprint transactions created by the Core wallet.
This commit is contained in:
glozow committed 2022-03-25 11:56:46 +00:00
1 parent 1e52e6bd0a
commit a44236addd
4 files changed
+47 -4

No files matched your search

+3 -1
View File
@@ -442,7 +442,9 @@ def test_watchonly_psbt(self, peer_node, rbf_node, dest_address):
self.generate(peer_node, 1)
# Create single-input PSBT for transaction to be bumped
psbt = watcher.walletcreatefundedpsbt([], {dest_address: 0.0005}, 0, {"fee_rate": 1}, True)['psbt']
# Ensure the payment amount + change can be fully funded using one of the 0.001BTC inputs.
psbt = watcher.walletcreatefundedpsbt([watcher.listunspent()[0]], {dest_address: 0.0005}, 0,
{"fee_rate": 1, "add_inputs": False}, True)['psbt']
psbt_signed = signer.walletprocesspsbt(psbt=psbt, sign=True, sighashtype="ALL", bip32derivs=True)
psbt_final = watcher.finalizepsbt(psbt_signed["psbt"])
original_txid = watcher.sendrawtransaction(psbt_final["hex"])