You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wallet_basic.py 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. #!/usr/bin/env python3
  2. # Copyright (c) 2014-2017 The Bitcoin Core developers
  3. # Distributed under the MIT software license, see the accompanying
  4. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. """Test the wallet."""
  6. from test_framework.test_framework import BitcoinTestFramework
  7. from test_framework.util import *
  8. class WalletTest(BitcoinTestFramework):
  9. def set_test_params(self):
  10. self.num_nodes = 4
  11. self.setup_clean_chain = True
  12. def setup_network(self):
  13. self.add_nodes(4)
  14. self.start_node(0)
  15. self.start_node(1)
  16. self.start_node(2)
  17. connect_nodes_bi(self.nodes,0,1)
  18. connect_nodes_bi(self.nodes,1,2)
  19. connect_nodes_bi(self.nodes,0,2)
  20. self.sync_all([self.nodes[0:3]])
  21. def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size):
  22. """Return curr_balance after asserting the fee was in range"""
  23. fee = balance_with_fee - curr_balance
  24. assert_fee_amount(fee, tx_size, fee_per_byte * 1000)
  25. return curr_balance
  26. def get_vsize(self, txn):
  27. return self.nodes[0].decoderawtransaction(txn)['vsize']
  28. def run_test(self):
  29. # Check that there's no UTXO on none of the nodes
  30. assert_equal(len(self.nodes[0].listunspent()), 0)
  31. assert_equal(len(self.nodes[1].listunspent()), 0)
  32. assert_equal(len(self.nodes[2].listunspent()), 0)
  33. self.log.info("Mining blocks...")
  34. self.nodes[0].generate(1)
  35. walletinfo = self.nodes[0].getwalletinfo()
  36. assert_equal(walletinfo['immature_balance'], 50)
  37. assert_equal(walletinfo['balance'], 0)
  38. self.sync_all([self.nodes[0:3]])
  39. self.nodes[1].generate(101)
  40. self.sync_all([self.nodes[0:3]])
  41. assert_equal(self.nodes[0].getbalance(), 50)
  42. assert_equal(self.nodes[1].getbalance(), 50)
  43. assert_equal(self.nodes[2].getbalance(), 0)
  44. # Check that only first and second nodes have UTXOs
  45. utxos = self.nodes[0].listunspent()
  46. assert_equal(len(utxos), 1)
  47. assert_equal(len(self.nodes[1].listunspent()), 1)
  48. assert_equal(len(self.nodes[2].listunspent()), 0)
  49. self.log.info("test gettxout")
  50. confirmed_txid, confirmed_index = utxos[0]["txid"], utxos[0]["vout"]
  51. # First, outputs that are unspent both in the chain and in the
  52. # mempool should appear with or without include_mempool
  53. txout = self.nodes[0].gettxout(txid=confirmed_txid, n=confirmed_index, include_mempool=False)
  54. assert_equal(txout['value'], 50)
  55. txout = self.nodes[0].gettxout(txid=confirmed_txid, n=confirmed_index, include_mempool=True)
  56. assert_equal(txout['value'], 50)
  57. # Send 21 BTC from 0 to 2 using sendtoaddress call.
  58. # Locked memory should use at least 32 bytes to sign each transaction
  59. self.log.info("test getmemoryinfo")
  60. memory_before = self.nodes[0].getmemoryinfo()
  61. self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
  62. mempool_txid = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
  63. memory_after = self.nodes[0].getmemoryinfo()
  64. assert(memory_before['locked']['used'] + 64 <= memory_after['locked']['used'])
  65. self.log.info("test gettxout (second part)")
  66. # utxo spent in mempool should be visible if you exclude mempool
  67. # but invisible if you include mempool
  68. txout = self.nodes[0].gettxout(confirmed_txid, confirmed_index, False)
  69. assert_equal(txout['value'], 50)
  70. txout = self.nodes[0].gettxout(confirmed_txid, confirmed_index, True)
  71. assert txout is None
  72. # new utxo from mempool should be invisible if you exclude mempool
  73. # but visible if you include mempool
  74. txout = self.nodes[0].gettxout(mempool_txid, 0, False)
  75. assert txout is None
  76. txout1 = self.nodes[0].gettxout(mempool_txid, 0, True)
  77. txout2 = self.nodes[0].gettxout(mempool_txid, 1, True)
  78. # note the mempool tx will have randomly assigned indices
  79. # but 10 will go to node2 and the rest will go to node0
  80. balance = self.nodes[0].getbalance()
  81. assert_equal(set([txout1['value'], txout2['value']]), set([10, balance]))
  82. walletinfo = self.nodes[0].getwalletinfo()
  83. assert_equal(walletinfo['immature_balance'], 0)
  84. # Have node0 mine a block, thus it will collect its own fee.
  85. self.nodes[0].generate(1)
  86. self.sync_all([self.nodes[0:3]])
  87. # Exercise locking of unspent outputs
  88. unspent_0 = self.nodes[2].listunspent()[0]
  89. unspent_0 = {"txid": unspent_0["txid"], "vout": unspent_0["vout"]}
  90. assert_raises_rpc_error(-8, "Invalid parameter, expected locked output", self.nodes[2].lockunspent, True, [unspent_0])
  91. self.nodes[2].lockunspent(False, [unspent_0])
  92. assert_raises_rpc_error(-8, "Invalid parameter, output already locked", self.nodes[2].lockunspent, False, [unspent_0])
  93. assert_raises_rpc_error(-4, "Insufficient funds", self.nodes[2].sendtoaddress, self.nodes[2].getnewaddress(), 20)
  94. assert_equal([unspent_0], self.nodes[2].listlockunspent())
  95. self.nodes[2].lockunspent(True, [unspent_0])
  96. assert_equal(len(self.nodes[2].listlockunspent()), 0)
  97. assert_raises_rpc_error(-8, "Invalid parameter, unknown transaction",
  98. self.nodes[2].lockunspent, False,
  99. [{"txid": "0000000000000000000000000000000000", "vout": 0}])
  100. assert_raises_rpc_error(-8, "Invalid parameter, vout index out of bounds",
  101. self.nodes[2].lockunspent, False,
  102. [{"txid": unspent_0["txid"], "vout": 999}])
  103. # Have node1 generate 100 blocks (so node0 can recover the fee)
  104. self.nodes[1].generate(100)
  105. self.sync_all([self.nodes[0:3]])
  106. # node0 should end up with 100 btc in block rewards plus fees, but
  107. # minus the 21 plus fees sent to node2
  108. assert_equal(self.nodes[0].getbalance(), 100-21)
  109. assert_equal(self.nodes[2].getbalance(), 21)
  110. # Node0 should have two unspent outputs.
  111. # Create a couple of transactions to send them to node2, submit them through
  112. # node1, and make sure both node0 and node2 pick them up properly:
  113. node0utxos = self.nodes[0].listunspent(1)
  114. assert_equal(len(node0utxos), 2)
  115. # create both transactions
  116. txns_to_send = []
  117. for utxo in node0utxos:
  118. inputs = []
  119. outputs = {}
  120. inputs.append({ "txid" : utxo["txid"], "vout" : utxo["vout"]})
  121. outputs[self.nodes[2].getnewaddress("from1")] = utxo["amount"] - 3
  122. raw_tx = self.nodes[0].createrawtransaction(inputs, outputs)
  123. txns_to_send.append(self.nodes[0].signrawtransaction(raw_tx))
  124. # Have node 1 (miner) send the transactions
  125. self.nodes[1].sendrawtransaction(txns_to_send[0]["hex"], True)
  126. self.nodes[1].sendrawtransaction(txns_to_send[1]["hex"], True)
  127. # Have node1 mine a block to confirm transactions:
  128. self.nodes[1].generate(1)
  129. self.sync_all([self.nodes[0:3]])
  130. assert_equal(self.nodes[0].getbalance(), 0)
  131. assert_equal(self.nodes[2].getbalance(), 94)
  132. assert_equal(self.nodes[2].getbalance("from1"), 94-21)
  133. # Verify that a spent output cannot be locked anymore
  134. spent_0 = {"txid": node0utxos[0]["txid"], "vout": node0utxos[0]["vout"]}
  135. assert_raises_rpc_error(-8, "Invalid parameter, expected unspent output", self.nodes[0].lockunspent, False, [spent_0])
  136. # Send 10 BTC normal
  137. address = self.nodes[0].getnewaddress("test")
  138. fee_per_byte = Decimal('0.001') / 1000
  139. self.nodes[2].settxfee(fee_per_byte * 1000)
  140. txid = self.nodes[2].sendtoaddress(address, 10, "", "", False)
  141. self.nodes[2].generate(1)
  142. self.sync_all([self.nodes[0:3]])
  143. node_2_bal = self.check_fee_amount(self.nodes[2].getbalance(), Decimal('84'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))
  144. assert_equal(self.nodes[0].getbalance(), Decimal('10'))
  145. # Send 10 BTC with subtract fee from amount
  146. txid = self.nodes[2].sendtoaddress(address, 10, "", "", True)
  147. self.nodes[2].generate(1)
  148. self.sync_all([self.nodes[0:3]])
  149. node_2_bal -= Decimal('10')
  150. assert_equal(self.nodes[2].getbalance(), node_2_bal)
  151. node_0_bal = self.check_fee_amount(self.nodes[0].getbalance(), Decimal('20'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))
  152. # Sendmany 10 BTC
  153. txid = self.nodes[2].sendmany('from1', {address: 10}, 0, "", [])
  154. self.nodes[2].generate(1)
  155. self.sync_all([self.nodes[0:3]])
  156. node_0_bal += Decimal('10')
  157. node_2_bal = self.check_fee_amount(self.nodes[2].getbalance(), node_2_bal - Decimal('10'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))
  158. assert_equal(self.nodes[0].getbalance(), node_0_bal)
  159. # Sendmany 10 BTC with subtract fee from amount
  160. txid = self.nodes[2].sendmany('from1', {address: 10}, 0, "", [address])
  161. self.nodes[2].generate(1)
  162. self.sync_all([self.nodes[0:3]])
  163. node_2_bal -= Decimal('10')
  164. assert_equal(self.nodes[2].getbalance(), node_2_bal)
  165. node_0_bal = self.check_fee_amount(self.nodes[0].getbalance(), node_0_bal + Decimal('10'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))
  166. # Test ResendWalletTransactions:
  167. # Create a couple of transactions, then start up a fourth
  168. # node (nodes[3]) and ask nodes[0] to rebroadcast.
  169. # EXPECT: nodes[3] should have those transactions in its mempool.
  170. txid1 = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)
  171. txid2 = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
  172. sync_mempools(self.nodes[0:2])
  173. self.start_node(3)
  174. connect_nodes_bi(self.nodes, 0, 3)
  175. sync_blocks(self.nodes)
  176. relayed = self.nodes[0].resendwallettransactions()
  177. assert_equal(set(relayed), {txid1, txid2})
  178. sync_mempools(self.nodes)
  179. assert(txid1 in self.nodes[3].getrawmempool())
  180. # Exercise balance rpcs
  181. assert_equal(self.nodes[0].getwalletinfo()["unconfirmed_balance"], 1)
  182. assert_equal(self.nodes[0].getunconfirmedbalance(), 1)
  183. #check if we can list zero value tx as available coins
  184. #1. create rawtx
  185. #2. hex-changed one output to 0.0
  186. #3. sign and send
  187. #4. check if recipient (node0) can list the zero value tx
  188. usp = self.nodes[1].listunspent()
  189. inputs = [{"txid":usp[0]['txid'], "vout":usp[0]['vout']}]
  190. outputs = {self.nodes[1].getnewaddress(): 49.998, self.nodes[0].getnewaddress(): 11.11}
  191. rawTx = self.nodes[1].createrawtransaction(inputs, outputs).replace("c0833842", "00000000") #replace 11.11 with 0.0 (int32)
  192. decRawTx = self.nodes[1].decoderawtransaction(rawTx)
  193. signedRawTx = self.nodes[1].signrawtransaction(rawTx)
  194. decRawTx = self.nodes[1].decoderawtransaction(signedRawTx['hex'])
  195. zeroValueTxid= decRawTx['txid']
  196. self.nodes[1].sendrawtransaction(signedRawTx['hex'])
  197. self.sync_all()
  198. self.nodes[1].generate(1) #mine a block
  199. self.sync_all()
  200. unspentTxs = self.nodes[0].listunspent() #zero value tx must be in listunspents output
  201. found = False
  202. for uTx in unspentTxs:
  203. if uTx['txid'] == zeroValueTxid:
  204. found = True
  205. assert_equal(uTx['amount'], Decimal('0'))
  206. assert(found)
  207. #do some -walletbroadcast tests
  208. self.stop_nodes()
  209. self.start_node(0, ["-walletbroadcast=0"])
  210. self.start_node(1, ["-walletbroadcast=0"])
  211. self.start_node(2, ["-walletbroadcast=0"])
  212. connect_nodes_bi(self.nodes,0,1)
  213. connect_nodes_bi(self.nodes,1,2)
  214. connect_nodes_bi(self.nodes,0,2)
  215. self.sync_all([self.nodes[0:3]])
  216. txIdNotBroadcasted = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 2)
  217. txObjNotBroadcasted = self.nodes[0].gettransaction(txIdNotBroadcasted)
  218. self.nodes[1].generate(1) #mine a block, tx should not be in there
  219. self.sync_all([self.nodes[0:3]])
  220. assert_equal(self.nodes[2].getbalance(), node_2_bal) #should not be changed because tx was not broadcasted
  221. #now broadcast from another node, mine a block, sync, and check the balance
  222. self.nodes[1].sendrawtransaction(txObjNotBroadcasted['hex'])
  223. self.nodes[1].generate(1)
  224. self.sync_all([self.nodes[0:3]])
  225. node_2_bal += 2
  226. txObjNotBroadcasted = self.nodes[0].gettransaction(txIdNotBroadcasted)
  227. assert_equal(self.nodes[2].getbalance(), node_2_bal)
  228. #create another tx
  229. txIdNotBroadcasted = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 2)
  230. #restart the nodes with -walletbroadcast=1
  231. self.stop_nodes()
  232. self.start_node(0)
  233. self.start_node(1)
  234. self.start_node(2)
  235. connect_nodes_bi(self.nodes,0,1)
  236. connect_nodes_bi(self.nodes,1,2)
  237. connect_nodes_bi(self.nodes,0,2)
  238. sync_blocks(self.nodes[0:3])
  239. self.nodes[0].generate(1)
  240. sync_blocks(self.nodes[0:3])
  241. node_2_bal += 2
  242. #tx should be added to balance because after restarting the nodes tx should be broadcastet
  243. assert_equal(self.nodes[2].getbalance(), node_2_bal)
  244. #send a tx with value in a string (PR#6380 +)
  245. txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "2")
  246. txObj = self.nodes[0].gettransaction(txId)
  247. assert_equal(txObj['amount'], Decimal('-2'))
  248. txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "0.0001")
  249. txObj = self.nodes[0].gettransaction(txId)
  250. assert_equal(txObj['amount'], Decimal('-0.0001'))
  251. #check if JSON parser can handle scientific notation in strings
  252. txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "1e-4")
  253. txObj = self.nodes[0].gettransaction(txId)
  254. assert_equal(txObj['amount'], Decimal('-0.0001'))
  255. # This will raise an exception because the amount type is wrong
  256. assert_raises_rpc_error(-3, "Invalid amount", self.nodes[0].sendtoaddress, self.nodes[2].getnewaddress(), "1f-4")
  257. # This will raise an exception since generate does not accept a string
  258. assert_raises_rpc_error(-1, "not an integer", self.nodes[0].generate, "2")
  259. # Import address and private key to check correct behavior of spendable unspents
  260. # 1. Send some coins to generate new UTXO
  261. address_to_import = self.nodes[2].getnewaddress()
  262. txid = self.nodes[0].sendtoaddress(address_to_import, 1)
  263. self.nodes[0].generate(1)
  264. self.sync_all([self.nodes[0:3]])
  265. # 2. Import address from node2 to node1
  266. self.nodes[1].importaddress(address_to_import)
  267. # 3. Validate that the imported address is watch-only on node1
  268. assert(self.nodes[1].validateaddress(address_to_import)["iswatchonly"])
  269. # 4. Check that the unspents after import are not spendable
  270. assert_array_result(self.nodes[1].listunspent(),
  271. {"address": address_to_import},
  272. {"spendable": False})
  273. # 5. Import private key of the previously imported address on node1
  274. priv_key = self.nodes[2].dumpprivkey(address_to_import)
  275. self.nodes[1].importprivkey(priv_key)
  276. # 6. Check that the unspents are now spendable on node1
  277. assert_array_result(self.nodes[1].listunspent(),
  278. {"address": address_to_import},
  279. {"spendable": True})
  280. # Mine a block from node0 to an address from node1
  281. cbAddr = self.nodes[1].getnewaddress()
  282. blkHash = self.nodes[0].generatetoaddress(1, cbAddr)[0]
  283. cbTxId = self.nodes[0].getblock(blkHash)['tx'][0]
  284. self.sync_all([self.nodes[0:3]])
  285. # Check that the txid and balance is found by node1
  286. self.nodes[1].gettransaction(cbTxId)
  287. # check if wallet or blockchain maintenance changes the balance
  288. self.sync_all([self.nodes[0:3]])
  289. blocks = self.nodes[0].generate(2)
  290. self.sync_all([self.nodes[0:3]])
  291. balance_nodes = [self.nodes[i].getbalance() for i in range(3)]
  292. block_count = self.nodes[0].getblockcount()
  293. # Check modes:
  294. # - True: unicode escaped as \u....
  295. # - False: unicode directly as UTF-8
  296. for mode in [True, False]:
  297. self.nodes[0].ensure_ascii = mode
  298. # unicode check: Basic Multilingual Plane, Supplementary Plane respectively
  299. for s in [u'рыба', u'𝅘𝅥𝅯']:
  300. addr = self.nodes[0].getaccountaddress(s)
  301. label = self.nodes[0].getaccount(addr)
  302. assert_equal(label, s)
  303. assert(s in self.nodes[0].listaccounts().keys())
  304. self.nodes[0].ensure_ascii = True # restore to default
  305. # maintenance tests
  306. maintenance = [
  307. '-rescan',
  308. '-reindex',
  309. '-zapwallettxes=1',
  310. '-zapwallettxes=2',
  311. # disabled until issue is fixed: https://github.com/bitcoin/bitcoin/issues/7463
  312. # '-salvagewallet',
  313. ]
  314. chainlimit = 6
  315. for m in maintenance:
  316. self.log.info("check " + m)
  317. self.stop_nodes()
  318. # set lower ancestor limit for later
  319. self.start_node(0, [m, "-limitancestorcount="+str(chainlimit)])
  320. self.start_node(1, [m, "-limitancestorcount="+str(chainlimit)])
  321. self.start_node(2, [m, "-limitancestorcount="+str(chainlimit)])
  322. if m == '-reindex':
  323. # reindex will leave rpc warm up "early"; Wait for it to finish
  324. wait_until(lambda: [block_count] * 3 == [self.nodes[i].getblockcount() for i in range(3)])
  325. assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)])
  326. # Exercise listsinceblock with the last two blocks
  327. coinbase_tx_1 = self.nodes[0].listsinceblock(blocks[0])
  328. assert_equal(coinbase_tx_1["lastblock"], blocks[1])
  329. assert_equal(len(coinbase_tx_1["transactions"]), 1)
  330. assert_equal(coinbase_tx_1["transactions"][0]["blockhash"], blocks[1])
  331. assert_equal(len(self.nodes[0].listsinceblock(blocks[1])["transactions"]), 0)
  332. # ==Check that wallet prefers to use coins that don't exceed mempool limits =====
  333. # Get all non-zero utxos together
  334. chain_addrs = [self.nodes[0].getnewaddress(), self.nodes[0].getnewaddress()]
  335. singletxid = self.nodes[0].sendtoaddress(chain_addrs[0], self.nodes[0].getbalance(), "", "", True)
  336. self.nodes[0].generate(1)
  337. node0_balance = self.nodes[0].getbalance()
  338. # Split into two chains
  339. rawtx = self.nodes[0].createrawtransaction([{"txid":singletxid, "vout":0}], {chain_addrs[0]:node0_balance/2-Decimal('0.01'), chain_addrs[1]:node0_balance/2-Decimal('0.01')})
  340. signedtx = self.nodes[0].signrawtransaction(rawtx)
  341. singletxid = self.nodes[0].sendrawtransaction(signedtx["hex"])
  342. self.nodes[0].generate(1)
  343. # Make a long chain of unconfirmed payments without hitting mempool limit
  344. # Each tx we make leaves only one output of change on a chain 1 longer
  345. # Since the amount to send is always much less than the outputs, we only ever need one output
  346. # So we should be able to generate exactly chainlimit txs for each original output
  347. sending_addr = self.nodes[1].getnewaddress()
  348. txid_list = []
  349. for i in range(chainlimit*2):
  350. txid_list.append(self.nodes[0].sendtoaddress(sending_addr, Decimal('0.0001')))
  351. assert_equal(self.nodes[0].getmempoolinfo()['size'], chainlimit*2)
  352. assert_equal(len(txid_list), chainlimit*2)
  353. # Without walletrejectlongchains, we will still generate a txid
  354. # The tx will be stored in the wallet but not accepted to the mempool
  355. extra_txid = self.nodes[0].sendtoaddress(sending_addr, Decimal('0.0001'))
  356. assert(extra_txid not in self.nodes[0].getrawmempool())
  357. assert(extra_txid in [tx["txid"] for tx in self.nodes[0].listtransactions()])
  358. self.nodes[0].abandontransaction(extra_txid)
  359. total_txs = len(self.nodes[0].listtransactions("*",99999))
  360. # Try with walletrejectlongchains
  361. # Double chain limit but require combining inputs, so we pass SelectCoinsMinConf
  362. self.stop_node(0)
  363. self.start_node(0, extra_args=["-walletrejectlongchains", "-limitancestorcount="+str(2*chainlimit)])
  364. # wait for loadmempool
  365. timeout = 10
  366. while (timeout > 0 and len(self.nodes[0].getrawmempool()) < chainlimit*2):
  367. time.sleep(0.5)
  368. timeout -= 0.5
  369. assert_equal(len(self.nodes[0].getrawmempool()), chainlimit*2)
  370. node0_balance = self.nodes[0].getbalance()
  371. # With walletrejectlongchains we will not create the tx and store it in our wallet.
  372. assert_raises_rpc_error(-4, "Transaction has too long of a mempool chain", self.nodes[0].sendtoaddress, sending_addr, node0_balance - Decimal('0.01'))
  373. # Verify nothing new in wallet
  374. assert_equal(total_txs, len(self.nodes[0].listtransactions("*",99999)))
  375. if __name__ == '__main__':
  376. WalletTest().main()