@@ -33,7 +33,7 @@ def setup_network(self):
33
33
connect_nodes_bi (self .nodes , 0 , 1 )
34
34
connect_nodes_bi (self .nodes , 1 , 2 )
35
35
connect_nodes_bi (self .nodes , 0 , 2 )
36
- self .sync_all ([ self .nodes [0 :3 ] ])
36
+ self .sync_all (self .nodes [0 :3 ])
37
37
38
38
def check_fee_amount (self , curr_balance , balance_with_fee , fee_per_byte , tx_size ):
39
39
"""Return curr_balance after asserting the fee was in range"""
@@ -58,9 +58,9 @@ def run_test(self):
58
58
assert_equal (walletinfo ['immature_balance' ], 50 )
59
59
assert_equal (walletinfo ['balance' ], 0 )
60
60
61
- self .sync_all ([ self .nodes [0 :3 ] ])
61
+ self .sync_all (self .nodes [0 :3 ])
62
62
self .nodes [1 ].generate (101 )
63
- self .sync_all ([ self .nodes [0 :3 ] ])
63
+ self .sync_all (self .nodes [0 :3 ])
64
64
65
65
assert_equal (self .nodes [0 ].getbalance (), 50 )
66
66
assert_equal (self .nodes [1 ].getbalance (), 50 )
@@ -107,7 +107,7 @@ def run_test(self):
107
107
108
108
# Have node0 mine a block, thus it will collect its own fee.
109
109
self .nodes [0 ].generate (1 )
110
- self .sync_all ([ self .nodes [0 :3 ] ])
110
+ self .sync_all (self .nodes [0 :3 ])
111
111
112
112
# Exercise locking of unspent outputs
113
113
unspent_0 = self .nodes [2 ].listunspent ()[0 ]
@@ -143,7 +143,7 @@ def run_test(self):
143
143
144
144
# Have node1 generate 100 blocks (so node0 can recover the fee)
145
145
self .nodes [1 ].generate (100 )
146
- self .sync_all ([ self .nodes [0 :3 ] ])
146
+ self .sync_all (self .nodes [0 :3 ])
147
147
148
148
# node0 should end up with 100 btc in block rewards plus fees, but
149
149
# minus the 21 plus fees sent to node2
@@ -172,7 +172,7 @@ def run_test(self):
172
172
173
173
# Have node1 mine a block to confirm transactions:
174
174
self .nodes [1 ].generate (1 )
175
- self .sync_all ([ self .nodes [0 :3 ] ])
175
+ self .sync_all (self .nodes [0 :3 ])
176
176
177
177
assert_equal (self .nodes [0 ].getbalance (), 0 )
178
178
assert_equal (self .nodes [2 ].getbalance (), 94 )
@@ -187,30 +187,30 @@ def run_test(self):
187
187
self .nodes [2 ].settxfee (fee_per_byte * 1000 )
188
188
txid = self .nodes [2 ].sendtoaddress (address , 10 , "" , "" , False )
189
189
self .nodes [2 ].generate (1 )
190
- self .sync_all ([ self .nodes [0 :3 ] ])
190
+ self .sync_all (self .nodes [0 :3 ])
191
191
node_2_bal = self .check_fee_amount (self .nodes [2 ].getbalance (), Decimal ('84' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )['hex' ]))
192
192
assert_equal (self .nodes [0 ].getbalance (), Decimal ('10' ))
193
193
194
194
# Send 10 BTC with subtract fee from amount
195
195
txid = self .nodes [2 ].sendtoaddress (address , 10 , "" , "" , True )
196
196
self .nodes [2 ].generate (1 )
197
- self .sync_all ([ self .nodes [0 :3 ] ])
197
+ self .sync_all (self .nodes [0 :3 ])
198
198
node_2_bal -= Decimal ('10' )
199
199
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
200
200
node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), Decimal ('20' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )['hex' ]))
201
201
202
202
# Sendmany 10 BTC
203
203
txid = self .nodes [2 ].sendmany ('' , {address : 10 }, 0 , "" , [])
204
204
self .nodes [2 ].generate (1 )
205
- self .sync_all ([ self .nodes [0 :3 ] ])
205
+ self .sync_all (self .nodes [0 :3 ])
206
206
node_0_bal += Decimal ('10' )
207
207
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 ].gettransaction (txid )['hex' ]))
208
208
assert_equal (self .nodes [0 ].getbalance (), node_0_bal )
209
209
210
210
# Sendmany 10 BTC with subtract fee from amount
211
211
txid = self .nodes [2 ].sendmany ('' , {address : 10 }, 0 , "" , [address ])
212
212
self .nodes [2 ].generate (1 )
213
- self .sync_all ([ self .nodes [0 :3 ] ])
213
+ self .sync_all (self .nodes [0 :3 ])
214
214
node_2_bal -= Decimal ('10' )
215
215
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
216
216
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 ].gettransaction (txid )['hex' ]))
@@ -254,18 +254,18 @@ def run_test(self):
254
254
connect_nodes_bi (self .nodes , 0 , 1 )
255
255
connect_nodes_bi (self .nodes , 1 , 2 )
256
256
connect_nodes_bi (self .nodes , 0 , 2 )
257
- self .sync_all ([ self .nodes [0 :3 ] ])
257
+ self .sync_all (self .nodes [0 :3 ])
258
258
259
259
txid_not_broadcast = self .nodes [0 ].sendtoaddress (self .nodes [2 ].getnewaddress (), 2 )
260
260
tx_obj_not_broadcast = self .nodes [0 ].gettransaction (txid_not_broadcast )
261
261
self .nodes [1 ].generate (1 ) # mine a block, tx should not be in there
262
- self .sync_all ([ self .nodes [0 :3 ] ])
262
+ self .sync_all (self .nodes [0 :3 ])
263
263
assert_equal (self .nodes [2 ].getbalance (), node_2_bal ) # should not be changed because tx was not broadcasted
264
264
265
265
# now broadcast from another node, mine a block, sync, and check the balance
266
266
self .nodes [1 ].sendrawtransaction (tx_obj_not_broadcast ['hex' ])
267
267
self .nodes [1 ].generate (1 )
268
- self .sync_all ([ self .nodes [0 :3 ] ])
268
+ self .sync_all (self .nodes [0 :3 ])
269
269
node_2_bal += 2
270
270
tx_obj_not_broadcast = self .nodes [0 ].gettransaction (txid_not_broadcast )
271
271
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
@@ -341,7 +341,7 @@ def run_test(self):
341
341
address_to_import = self .nodes [2 ].getnewaddress ()
342
342
txid = self .nodes [0 ].sendtoaddress (address_to_import , 1 )
343
343
self .nodes [0 ].generate (1 )
344
- self .sync_all ([ self .nodes [0 :3 ] ])
344
+ self .sync_all (self .nodes [0 :3 ])
345
345
346
346
# 2. Import address from node2 to node1
347
347
self .nodes [1 ].importaddress (address_to_import )
@@ -367,15 +367,15 @@ def run_test(self):
367
367
coinbase_addr = self .nodes [1 ].getnewaddress ()
368
368
block_hash = self .nodes [0 ].generatetoaddress (1 , coinbase_addr )[0 ]
369
369
coinbase_txid = self .nodes [0 ].getblock (block_hash )['tx' ][0 ]
370
- self .sync_all ([ self .nodes [0 :3 ] ])
370
+ self .sync_all (self .nodes [0 :3 ])
371
371
372
372
# Check that the txid and balance is found by node1
373
373
self .nodes [1 ].gettransaction (coinbase_txid )
374
374
375
375
# check if wallet or blockchain maintenance changes the balance
376
- self .sync_all ([ self .nodes [0 :3 ] ])
376
+ self .sync_all (self .nodes [0 :3 ])
377
377
blocks = self .nodes [0 ].generate (2 )
378
- self .sync_all ([ self .nodes [0 :3 ] ])
378
+ self .sync_all (self .nodes [0 :3 ])
379
379
balance_nodes = [self .nodes [i ].getbalance () for i in range (3 )]
380
380
block_count = self .nodes [0 ].getblockcount ()
381
381
0 commit comments