File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,15 @@ def test_timewarp(self):
159
159
bad_block .solve ()
160
160
assert_raises_rpc_error (- 25 , 'time-timewarp-attack' , lambda : node .submitheader (hexdata = CBlockHeader (bad_block ).serialize ().hex ()))
161
161
162
+ self .log .info ("Test timewarp protection boundary" )
163
+ bad_block .nTime = t + MAX_FUTURE_BLOCK_TIME - MAX_TIMEWARP - 1
164
+ bad_block .solve ()
165
+ assert_raises_rpc_error (- 25 , 'time-timewarp-attack' , lambda : node .submitheader (hexdata = CBlockHeader (bad_block ).serialize ().hex ()))
166
+
167
+ bad_block .nTime = t + MAX_FUTURE_BLOCK_TIME - MAX_TIMEWARP
168
+ bad_block .solve ()
169
+ node .submitheader (hexdata = CBlockHeader (bad_block ).serialize ().hex ())
170
+
162
171
def run_test (self ):
163
172
node = self .nodes [0 ]
164
173
self .wallet = MiniWallet (node )
You can’t perform that action at this time.
0 commit comments