Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_abandonconflict.py
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Verify that even with a low min relay fee, the tx is not re-accepted | # Verify that even with a low min relay fee, the tx is not re-accepted | ||||
# from wallet on startup once abandoned. | # from wallet on startup once abandoned. | ||||
self.stop_node(0) | self.stop_node(0) | ||||
self.start_node(0, extra_args=["-minrelaytxfee=0.00001"]) | self.start_node(0, extra_args=["-minrelaytxfee=0.00001"]) | ||||
assert_equal(len(self.nodes[0].getrawmempool()), 0) | assert_equal(len(self.nodes[0].getrawmempool()), 0) | ||||
assert_equal(self.nodes[0].getbalance(), balance) | assert_equal(self.nodes[0].getbalance(), balance) | ||||
# If the transaction is re-sent the wallet also unabandons it. The | # If the transaction is re-sent the wallet also unabandons it. The | ||||
# change should be available, and it's child transaction should remain | # change should be available, and it's child transaction should remain | ||||
# abandoned. | # abandoned. | ||||
# NOTE: Abandoned transactions are internal to the wallet, and tracked | # NOTE: Abandoned transactions are internal to the wallet, and tracked | ||||
# separately from other indices. | # separately from other indices. | ||||
self.nodes[0].sendrawtransaction(signed["hex"]) | self.nodes[0].sendrawtransaction(signed["hex"]) | ||||
newbalance = self.nodes[0].getbalance() | newbalance = self.nodes[0].getbalance() | ||||
assert_equal(newbalance, balance - Decimal("20") + Decimal("14.99998")) | assert_equal(newbalance, balance - Decimal("20") + Decimal("14.99998")) | ||||
balance = newbalance | balance = newbalance | ||||
# Send child tx again so it is not longer abandoned. | # Send child tx again so it is no longer abandoned. | ||||
self.nodes[0].sendrawtransaction(signed2["hex"]) | self.nodes[0].sendrawtransaction(signed2["hex"]) | ||||
newbalance = self.nodes[0].getbalance() | newbalance = self.nodes[0].getbalance() | ||||
assert_equal(newbalance, balance - Decimal("10") - | assert_equal(newbalance, balance - Decimal("10") - | ||||
Decimal("14.99998") + Decimal("24.9996")) | Decimal("14.99998") + Decimal("24.9996")) | ||||
balance = newbalance | balance = newbalance | ||||
# Reset to a higher relay fee so that we abandon a transaction | # Reset to a higher relay fee so that we abandon a transaction | ||||
self.stop_node(0) | self.stop_node(0) | ||||
Show All 40 Lines |