aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2015-12-18 12:35:50 +0100
committerMarcoFalke <falke.marco@gmail.com>2015-12-18 12:37:29 +0100
commitfa14d994843fe2d700c977653cd3133d0a77cb67 (patch)
tree4900b43f3624039a566cea07e1eb8aa55888056d /qa
parentfa0765d433eb6d44a5cbec44f136b62814c663e5 (diff)
downloadbitcoin-fa14d994843fe2d700c977653cd3133d0a77cb67.tar.xz
[qa] check if wallet or blochchain maintenance changes the balance
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/wallet.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py
index f6cffe6121..11abb5797b 100755
--- a/qa/rpc-tests/wallet.py
+++ b/qa/rpc-tests/wallet.py
@@ -197,8 +197,9 @@ class WalletTest (BitcoinTestFramework):
self.nodes[1].sendrawtransaction(txObjNotBroadcasted['hex'])
self.nodes[1].generate(1)
self.sync_all()
+ node_2_bal += 2
txObjNotBroadcasted = self.nodes[0].gettransaction(txIdNotBroadcasted)
- assert_equal(self.nodes[2].getbalance(), node_2_bal + Decimal('2')) #should not be
+ assert_equal(self.nodes[2].getbalance(), node_2_bal)
#create another tx
txIdNotBroadcasted = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 2)
@@ -214,9 +215,10 @@ class WalletTest (BitcoinTestFramework):
self.nodes[0].generate(1)
sync_blocks(self.nodes)
+ node_2_bal += 2
#tx should be added to balance because after restarting the nodes tx should be broadcastet
- assert_equal(self.nodes[2].getbalance(), node_2_bal + Decimal('4')) #should not be
+ assert_equal(self.nodes[2].getbalance(), node_2_bal)
#send a tx with value in a string (PR#6380 +)
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "2")
@@ -249,6 +251,29 @@ class WalletTest (BitcoinTestFramework):
assert_equal("not an integer" in errorString, True)
+ #check if wallet or blochchain maintenance changes the balance
+ self.sync_all()
+ self.nodes[0].generate(1)
+ self.sync_all()
+ balance_nodes = [self.nodes[i].getbalance() for i in range(3)]
+
+ maintenance = [
+ '-rescan',
+ '-reindex',
+ '-zapwallettxes=1',
+ '-zapwallettxes=2',
+ '-salvagewallet',
+ ]
+ for m in maintenance:
+ stop_nodes(self.nodes)
+ wait_bitcoinds()
+ self.nodes = start_nodes(3, self.options.tmpdir, [[m]] * 3)
+ connect_nodes_bi(self.nodes,0,1)
+ connect_nodes_bi(self.nodes,1,2)
+ connect_nodes_bi(self.nodes,0,2)
+ self.sync_all()
+ assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)])
+
if __name__ == '__main__':
WalletTest ().main ()