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):
49
49
block .solve ()
50
50
node .submitblock (ToHex (block ))
51
51
52
- # Transaction should not be rebroadcast
53
52
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 )
56
62
57
63
self .log .info ("Bump time & check that transaction is rebroadcast" )
58
64
# Transaction should be rebroadcast approximately 24 hours in the future,
59
65
# 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 )
62
67
wait_until (lambda : node .p2ps [1 ].tx_invs_received [txid ] >= 1 , lock = mininode_lock )
63
68
64
69
You can’t perform that action at this time.
0 commit comments