Skip to content

Commit fa347b2

Browse files
author
MarcoFalke
committed
test: Select at least the fee in wallet_bumpfee to avoid negative amounts
1 parent 1d53d72 commit fa347b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/wallet_bumpfee.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,15 @@ def test_notmine_bumpfee_fails(self, rbf_node, peer_node, dest_address):
211211
# here, the rbftx has a peer_node coin and then adds a rbf_node input
212212
# Note that this test depends upon the RPC code checking input ownership prior to change outputs
213213
# (since it can't use fundrawtransaction, it lacks a proper change output)
214-
utxos = [node.listunspent()[-1] for node in (rbf_node, peer_node)]
214+
fee = Decimal("0.001")
215+
utxos = [node.listunspent(query_options={'minimumAmount': fee})[-1] for node in (rbf_node, peer_node)]
215216
inputs = [{
216217
"txid": utxo["txid"],
217218
"vout": utxo["vout"],
218219
"address": utxo["address"],
219220
"sequence": BIP125_SEQUENCE_NUMBER
220221
} for utxo in utxos]
221-
output_val = sum(utxo["amount"] for utxo in utxos) - Decimal("0.001")
222+
output_val = sum(utxo["amount"] for utxo in utxos) - fee
222223
rawtx = rbf_node.createrawtransaction(inputs, {dest_address: output_val})
223224
signedtx = rbf_node.signrawtransactionwithwallet(rawtx)
224225
signedtx = peer_node.signrawtransactionwithwallet(signedtx["hex"])

0 commit comments

Comments
 (0)