File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -700,6 +700,21 @@ def run_test(self):
700
700
self .send_blocks ([b55 ], True )
701
701
self .save_spendable_output ()
702
702
703
+ # The block which was previously rejected because of being "too far(3 hours)" must be accepted 2 hours later.
704
+ # The new block is only 1 hour into future now and we must reorg onto to the new longer chain.
705
+ # The new bestblock b48p is invalidated manually.
706
+ # -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15)
707
+ # \-> b54 (15)
708
+ # -> b44 (14)\-> b48 () -> b48p ()
709
+ self .log .info ("Accept a previously rejected future block at a later time" )
710
+ node .setmocktime (int (time .time ()) + 2 * 60 * 60 )
711
+ self .move_tip (48 )
712
+ self .block_heights [b48 .sha256 ] = self .block_heights [b44 .sha256 ] + 1 # b48 is a parent of b44
713
+ b48p = self .next_block ("48p" )
714
+ self .send_blocks ([b48 , b48p ], success = True ) # Reorg to the longer chain
715
+ node .invalidateblock (b48p .hash ) # mark b48p as invalid
716
+ node .setmocktime (0 )
717
+
703
718
# Test Merkle tree malleability
704
719
#
705
720
# -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57p2 (16)
You can’t perform that action at this time.
0 commit comments