Skip to content

Commit f526046

Browse files
committed
adapt bumpfee change discard test to be more strict and add note on p2sh discrep
1 parent 5805d6f commit f526046

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/wallet_bumpfee.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ def test_dust_to_fee(rbf_node, dest_address):
181181
# the bumped tx sets fee=49,900, but it converts to 50,000
182182
rbfid = spend_one_input(rbf_node, dest_address)
183183
fulltx = rbf_node.getrawtransaction(rbfid, 1)
184-
bumped_tx = rbf_node.bumpfee(rbfid, {"totalFee": 49900})
184+
# (32-byte p2sh-pwpkh output size + 148 p2pkh spend estimate) * 10k(discard_rate) / 1000 = 1800
185+
# P2SH outputs are slightly "over-discarding" due to the IsDust calculation assuming it will
186+
# be spent as a P2PKH.
187+
bumped_tx = rbf_node.bumpfee(rbfid, {"totalFee": 50000-1800})
185188
full_bumped_tx = rbf_node.getrawtransaction(bumped_tx["txid"], 1)
186189
assert_equal(bumped_tx["fee"], Decimal("0.00050000"))
187190
assert_equal(len(fulltx["vout"]), 2)

0 commit comments

Comments
 (0)