@@ -128,13 +128,13 @@ def setup_network(self):
128128 self .sync_all ()
129129
130130 def success_mine (self , node , txid , sign , redeem_script = "" ):
131- send_to_witness (1 , node , getutxo (txid ), self .pubkey [0 ], False , Decimal ("71998 " ), sign , redeem_script )
131+ send_to_witness (1 , node , getutxo (txid ), self .pubkey [0 ], False , Decimal ("71999.998 " ), sign , redeem_script )
132132 block = self .generate (node , 1 )
133133 assert_equal (len (node .getblock (block [0 ])["tx" ]), 2 )
134134 self .sync_blocks ()
135135
136136 def fail_accept (self , node , error_msg , txid , sign , redeem_script = "" ):
137- assert_raises_rpc_error (- 26 , error_msg , send_to_witness , use_p2wsh = 1 , node = node , utxo = getutxo (txid ), pubkey = self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71998 " ), sign = sign , insert_redeem_script = redeem_script )
137+ assert_raises_rpc_error (- 26 , error_msg , send_to_witness , use_p2wsh = 1 , node = node , utxo = getutxo (txid ), pubkey = self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71999.998 " ), sign = sign , insert_redeem_script = redeem_script )
138138
139139 def run_test (self ):
140140 self .generate (self .nodes [0 ], 161 ) # block 161
@@ -197,15 +197,15 @@ def run_test(self):
197197 for _ in range (5 ):
198198 for n in range (3 ):
199199 for v in range (2 ):
200- wit_ids [n ][v ].append (send_to_witness (v , self .nodes [0 ], find_spendable_utxo (self .nodes [0 ], 72000 ), self .pubkey [n ], False , Decimal ("71999" )))
201- p2sh_ids [n ][v ].append (send_to_witness (v , self .nodes [0 ], find_spendable_utxo (self .nodes [0 ], 72000 ), self .pubkey [n ], True , Decimal ("71999" )))
200+ wit_ids [n ][v ].append (send_to_witness (v , self .nodes [0 ], find_spendable_utxo (self .nodes [0 ], 72000 ), self .pubkey [n ], False , Decimal ("71999.999 " )))
201+ p2sh_ids [n ][v ].append (send_to_witness (v , self .nodes [0 ], find_spendable_utxo (self .nodes [0 ], 72000 ), self .pubkey [n ], True , Decimal ("71999.999 " )))
202202
203203 self .generate (self .nodes [0 ], 1 ) # block 163
204204
205205 # Make sure all nodes recognize the transactions as theirs
206- assert_equal (self .nodes [0 ].getbalance (), balance_presetup - 60 * 72000 + 20 * Decimal ("71999" ) + 72000 )
207- assert_equal (self .nodes [1 ].getbalance (), 20 * Decimal ("71999" ))
208- assert_equal (self .nodes [2 ].getbalance (), 20 * Decimal ("71999" ))
206+ assert_equal (self .nodes [0 ].getbalance (), balance_presetup - 60 * 72000 + 20 * Decimal ("71999.999 " ) + 72000 )
207+ assert_equal (self .nodes [1 ].getbalance (), 20 * Decimal ("71999.999 " ))
208+ assert_equal (self .nodes [2 ].getbalance (), 20 * Decimal ("71999.999 " ))
209209
210210 self .log .info ("Verify unsigned p2sh witness txs without a redeem script are invalid" )
211211 self .fail_accept (self .nodes [2 ], "mandatory-script-verify-flag-failed (Operation not valid with the current stack size)" , p2sh_ids [NODE_2 ][P2WPKH ][1 ], sign = False )
@@ -215,10 +215,10 @@ def run_test(self):
215215
216216 self .log .info ("Verify witness txs are mined as soon as segwit activates" )
217217
218- send_to_witness (1 , self .nodes [2 ], getutxo (wit_ids [NODE_2 ][P2WPKH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71998 " ), sign = True )
219- send_to_witness (1 , self .nodes [2 ], getutxo (wit_ids [NODE_2 ][P2WSH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71998 " ), sign = True )
220- send_to_witness (1 , self .nodes [2 ], getutxo (p2sh_ids [NODE_2 ][P2WPKH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71998 " ), sign = True )
221- send_to_witness (1 , self .nodes [2 ], getutxo (p2sh_ids [NODE_2 ][P2WSH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71998 " ), sign = True )
218+ send_to_witness (1 , self .nodes [2 ], getutxo (wit_ids [NODE_2 ][P2WPKH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71999.998 " ), sign = True )
219+ send_to_witness (1 , self .nodes [2 ], getutxo (wit_ids [NODE_2 ][P2WSH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71999.998 " ), sign = True )
220+ send_to_witness (1 , self .nodes [2 ], getutxo (p2sh_ids [NODE_2 ][P2WPKH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71999.998 " ), sign = True )
221+ send_to_witness (1 , self .nodes [2 ], getutxo (p2sh_ids [NODE_2 ][P2WSH ][0 ]), self .pubkey [0 ], encode_p2sh = False , amount = Decimal ("71999.998 " ), sign = True )
222222
223223 assert_equal (len (self .nodes [2 ].getrawmempool ()), 4 )
224224 blockhash = self .generate (self .nodes [2 ], 1 )[0 ] # block 165 (first block with new rules)
@@ -287,7 +287,7 @@ def run_test(self):
287287 # tx2 (segwit input, paying to a non-segwit output) ->
288288 # tx3 (non-segwit input, paying to a non-segwit output).
289289 # tx1 is allowed to appear in the block, but no others.
290- txid1 = send_to_witness (1 , self .nodes [0 ], find_spendable_utxo (self .nodes [0 ], 72000 ), self .pubkey [0 ], False , Decimal ("71996 " ))
290+ txid1 = send_to_witness (1 , self .nodes [0 ], find_spendable_utxo (self .nodes [0 ], 72000 ), self .pubkey [0 ], False , Decimal ("71999.996 " ))
291291 hex_tx = self .nodes [0 ].gettransaction (txid )['hex' ]
292292 tx = tx_from_hex (hex_tx )
293293 assert tx .wit .is_null () # This should not be a segwit input
0 commit comments