mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
test: Select at least the fee in wallet_bumpfee to avoid negative amounts
This commit is contained in:
parent
1d53d72948
commit
fa347b2f25
1 changed files with 3 additions and 2 deletions
|
@ -211,14 +211,15 @@ def test_notmine_bumpfee_fails(self, rbf_node, peer_node, dest_address):
|
|||
# here, the rbftx has a peer_node coin and then adds a rbf_node input
|
||||
# Note that this test depends upon the RPC code checking input ownership prior to change outputs
|
||||
# (since it can't use fundrawtransaction, it lacks a proper change output)
|
||||
utxos = [node.listunspent()[-1] for node in (rbf_node, peer_node)]
|
||||
fee = Decimal("0.001")
|
||||
utxos = [node.listunspent(query_options={'minimumAmount': fee})[-1] for node in (rbf_node, peer_node)]
|
||||
inputs = [{
|
||||
"txid": utxo["txid"],
|
||||
"vout": utxo["vout"],
|
||||
"address": utxo["address"],
|
||||
"sequence": BIP125_SEQUENCE_NUMBER
|
||||
} for utxo in utxos]
|
||||
output_val = sum(utxo["amount"] for utxo in utxos) - Decimal("0.001")
|
||||
output_val = sum(utxo["amount"] for utxo in utxos) - fee
|
||||
rawtx = rbf_node.createrawtransaction(inputs, {dest_address: output_val})
|
||||
signedtx = rbf_node.signrawtransactionwithwallet(rawtx)
|
||||
signedtx = peer_node.signrawtransactionwithwallet(signedtx["hex"])
|
||||
|
|
Loading…
Add table
Reference in a new issue