aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_bumpfee.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-10 19:11:27 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-10 19:35:51 +0200
commita84b056d5f1bc28b08937af3485124e68bb93024 (patch)
tree94e6b64b17d0b4f565dc2e0e6d7d56c98017cbeb /test/functional/wallet_bumpfee.py
parent8d651ae32013440b2af1267e87a9d93759a9471f (diff)
parentf526046ef5d8300eab6f112f56f59fd3b7e11d33 (diff)
downloadbitcoin-a84b056d5f1bc28b08937af3485124e68bb93024.tar.xz
Merge #12749: [wallet] feebumper: discard change outputs below discard rate
f526046 adapt bumpfee change discard test to be more strict and add note on p2sh discrep (Gregory Sanders) 5805d6f feebumper: discard change outputs below discard rate (Gregory Sanders) Pull request description: The "discard rate" is the concept we use to ensure the wallet isnt creating not so useful just-above-relay dust. Outside of bumpfee previous to this PR, and manually creating such an output, the wallet will never make change outputs of that size, preferring to send them to fees instead. "Worst case" for the user is that users pay a slightly higher feerate than they were expecting, which is already a possibility with relay dust. Tree-SHA512: dd69351810dc1709437602e7db1be46e4e905ccd8e16d03952de8b4c1fdbf9cb7e6c99968930896baf6b5c7cb005a03ec0506a2669d22e21e32982e60329606b
Diffstat (limited to 'test/functional/wallet_bumpfee.py')
-rwxr-xr-xtest/functional/wallet_bumpfee.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py
index 5efc846b6e..fcc11abce0 100755
--- a/test/functional/wallet_bumpfee.py
+++ b/test/functional/wallet_bumpfee.py
@@ -179,7 +179,10 @@ def test_dust_to_fee(rbf_node, dest_address):
# the bumped tx sets fee=49,900, but it converts to 50,000
rbfid = spend_one_input(rbf_node, dest_address)
fulltx = rbf_node.getrawtransaction(rbfid, 1)
- bumped_tx = rbf_node.bumpfee(rbfid, {"totalFee": 49900})
+ # (32-byte p2sh-pwpkh output size + 148 p2pkh spend estimate) * 10k(discard_rate) / 1000 = 1800
+ # P2SH outputs are slightly "over-discarding" due to the IsDust calculation assuming it will
+ # be spent as a P2PKH.
+ bumped_tx = rbf_node.bumpfee(rbfid, {"totalFee": 50000-1800})
full_bumped_tx = rbf_node.getrawtransaction(bumped_tx["txid"], 1)
assert_equal(bumped_tx["fee"], Decimal("0.00050000"))
assert_equal(len(fulltx["vout"]), 2)