Skip to content

Commit

Permalink
Fix undefined behaviour in txn_doublespend.py test
Browse files Browse the repository at this point in the history
  • Loading branch information
psolstice committed Aug 20, 2024
1 parent 988f1c6 commit ae24627
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qa/rpc-tests/txn_doublespend.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def run_test(self):
node0_address_foo = self.nodes[0].getnewaddress("foo")
fund_foo_txid = self.nodes[0].sendfrom("", node0_address_foo, 969)
fund_foo_tx = self.nodes[0].gettransaction(fund_foo_txid)
self.nodes[0].lockunspent(False, [{"txid": fund_foo_txid, "vout": find_output(self.nodes[0], fund_foo_txid, 969)}])

node0_address_bar = self.nodes[0].getnewaddress("bar")
fund_bar_txid = self.nodes[0].sendfrom("", node0_address_bar, 29)
fund_bar_tx = self.nodes[0].gettransaction(fund_bar_txid)
self.nodes[0].lockunspent(True, [{"txid": fund_foo_txid, "vout": find_output(self.nodes[0], fund_foo_txid, 969)}])

assert_equal(self.nodes[0].getbalance(""),
starting_balance - 969 - 29 + fund_foo_tx["fee"] + fund_bar_tx["fee"])
Expand Down

0 comments on commit ae24627

Please sign in to comment.