File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -49,16 +49,21 @@ def run_test(self):
4949 block .solve ()
5050 node .submitblock (ToHex (block ))
5151
52- # Transaction should not be rebroadcast
5352 node .syncwithvalidationinterfacequeue ()
54- node .p2ps [1 ].sync_with_ping ()
55- assert_equal (node .p2ps [1 ].tx_invs_received [txid ], 0 )
53+ now = int (time .time ())
54+
55+ # Transaction should not be rebroadcast within first 12 hours
56+ # Leave 2 mins for buffer
57+ twelve_hrs = 12 * 60 * 60
58+ two_min = 2 * 60
59+ node .setmocktime (now + twelve_hrs - two_min )
60+ time .sleep (2 ) # ensure enough time has passed for rebroadcast attempt to occur
61+ assert_equal (txid in node .p2ps [1 ].get_invs (), False )
5662
5763 self .log .info ("Bump time & check that transaction is rebroadcast" )
5864 # Transaction should be rebroadcast approximately 24 hours in the future,
5965 # but can range from 12-36. So bump 36 hours to be sure.
60- rebroadcast_time = int (time .time ()) + 36 * 60 * 60
61- node .setmocktime (rebroadcast_time )
66+ node .setmocktime (now + 36 * 60 * 60 )
6267 wait_until (lambda : node .p2ps [1 ].tx_invs_received [txid ] >= 1 , lock = mininode_lock )
6368
6469
You can’t perform that action at this time.
0 commit comments