Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_abandonconflict.py
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Transactions which are not in the mempool should only reduce wallet balance. | # Transactions which are not in the mempool should only reduce wallet balance. | ||||
# Transaction inputs should still be spent, but the change not yet | # Transaction inputs should still be spent, but the change not yet | ||||
# received. | # received. | ||||
newbalance = self.nodes[0].getbalance() | newbalance = self.nodes[0].getbalance() | ||||
assert_equal(newbalance, balance - signed3_change) | assert_equal(newbalance, balance - signed3_change) | ||||
# Unconfirmed received funds that are not in mempool also shouldn't show | # Unconfirmed received funds that are not in mempool also shouldn't show | ||||
# up in unconfirmed balance. Note that the transactions stored in the wallet | # up in unconfirmed balance. Note that the transactions stored in the wallet | ||||
# are not necessarily in the node's mempool. | # are not necessarily in the node's mempool. | ||||
unconfbalance = self.nodes[0].getunconfirmedbalance( | balances = self.nodes[0].getbalances()['mine'] | ||||
) + self.nodes[0].getbalance() | assert_equal( | ||||
assert_equal(unconfbalance, newbalance) | balances['untrusted_pending'] + | ||||
balances['trusted'], | |||||
newbalance) | |||||
# Unconfirmed transactions which are not in the mempool should also | # Unconfirmed transactions which are not in the mempool should also | ||||
# not be in listunspent | # not be in listunspent | ||||
assert txABC2 not in [utxo["txid"] | assert txABC2 not in [utxo["txid"] | ||||
for utxo in self.nodes[0].listunspent(0)] | for utxo in self.nodes[0].listunspent(0)] | ||||
balance = newbalance | balance = newbalance | ||||
# Abandon original transaction and verify inputs are available again | # Abandon original transaction and verify inputs are available again | ||||
# including that the child tx was also abandoned | # including that the child tx was also abandoned | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |