aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_abandonconflict.py
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-07-12 17:19:00 -0400
committerBen Woosley <ben.woosley@gmail.com>2018-07-13 11:16:08 -0400
commit89e70f9d7fe384ef9de4fa3828d4c80523290186 (patch)
tree6b414840dd03987cddd9237864a98ecdf76ddfa1 /test/functional/wallet_abandonconflict.py
parentdcb154e5aad80e49ff41a7851604ac46f38cb167 (diff)
Fix that CWallet::AbandonTransaction would only traverse one level
Prior to this change, it would mark only the first layer of child transactions abandoned, due to always following the input hashTx rather than the current now tx.
Diffstat (limited to 'test/functional/wallet_abandonconflict.py')
-rwxr-xr-xtest/functional/wallet_abandonconflict.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/functional/wallet_abandonconflict.py b/test/functional/wallet_abandonconflict.py
index d5ef08d782..cf2120d4eb 100755
--- a/test/functional/wallet_abandonconflict.py
+++ b/test/functional/wallet_abandonconflict.py
@@ -70,9 +70,17 @@ class AbandonConflictTest(BitcoinTestFramework):
signed2 = self.nodes[0].signrawtransactionwithwallet(self.nodes[0].createrawtransaction(inputs, outputs))
txABC2 = self.nodes[0].sendrawtransaction(signed2["hex"])
+ # Create a child tx spending ABC2
+ signed3_change = Decimal("24.999")
+ inputs = [ {"txid":txABC2, "vout":0} ]
+ outputs = { self.nodes[0].getnewaddress(): signed3_change }
+ signed3 = self.nodes[0].signrawtransactionwithwallet(self.nodes[0].createrawtransaction(inputs, outputs))
+ # note tx is never directly referenced, only abandoned as a child of the above
+ self.nodes[0].sendrawtransaction(signed3["hex"])
+
# In mempool txs from self should increase balance from change
newbalance = self.nodes[0].getbalance()
- assert_equal(newbalance, balance - Decimal("30") + Decimal("24.9996"))
+ assert_equal(newbalance, balance - Decimal("30") + signed3_change)
balance = newbalance
# Restart the node with a higher min relay fee so the parent tx is no longer in mempool
@@ -87,7 +95,7 @@ class AbandonConflictTest(BitcoinTestFramework):
# Not in mempool txs from self should only reduce balance
# inputs are still spent, but change not received
newbalance = self.nodes[0].getbalance()
- assert_equal(newbalance, balance - Decimal("24.9996"))
+ assert_equal(newbalance, balance - signed3_change)
# Unconfirmed received funds that are not in mempool, also shouldn't show
# up in unconfirmed balance
unconfbalance = self.nodes[0].getunconfirmedbalance() + self.nodes[0].getbalance()