anchor.diff:      connect_node(net2_node2, net1, Cfg),
       T1 = erlang:system_time(millisecond),
   
  -    wait_for_value({height, Top2 + Length * 2}, Nodes, Length * 2 * ?MINING_TIMEOUT, Cfg),
  +    TargetHeight4 = MinedHeight3 + Length,
  +    %% Wait for one extra block for resolving potential fork caused by nodes mining distinct blocks at the same time.
  +    wait_for_value({height, 1 + TargetHeight4}, Nodes, (1 + Length) * ?MINING_TIMEOUT, Cfg),
   
       try_until(T1 + 2 * ping_interval(),
               fun() ->
  -              D1 = get_block(net1_node1, Top2 + Length * 2),
  -              D2 = get_block(net1_node2, Top2 + Length * 2),
  -              D3 = get_block(net2_node1, Top2 + Length * 2),
  -              D4 = get_block(net2_node2, Top2 + Length * 2),
  +              D1 = get_block(net1_node1, TargetHeight4),
  +              D2 = get_block(net1_node2, TargetHeight4),
  +              D3 = get_block(net2_node1, TargetHeight4),
  +              D4 = get_block(net2_node2, TargetHeight4),
   
                 %% Check the chain merged again
                 ?assertEqual(D1, D2),
  
positive.code:     start_node(net2_node2, Cfg),
  
      %% Starts with a net split
  
      wait_for_value({height, Length}, Nodes, Length * ?MINING_TIMEOUT, Cfg),
  
      A1 = get_block(net1_node1, Length),
      A2 = get_block(net1_node2, Length),
      A3 = get_block(net2_node1, Length),
      A4 = get_block(net2_node2, Length),
  
      %% Check that the chains are different
      ?assertEqual(A1, A2),
  
negative.code: 
      %% Mine Length blocks, this may take longer than ping interval
      %% if so, the chains should be in sync when it's done.
      TargetHeight2 = MinedHeight1 + Length,
      %% Wait for one extra block for resolving potential fork caused by nodes mining distinct blocks at the same time.
      wait_for_value({height, 1 + TargetHeight2}, Nodes, (1 + Length) * ?MINING_TIMEOUT, Cfg),
  
      %% Wait at least as long as the ping timer can take
      try_until(T0 + 2 * ping_interval(),
              fun() ->
  
                B1 = get_block(net1_node1, TargetHeight2),
                B2 = get_block(net1_node2, TargetHeight2),
                B3 = get_block(net2_node1, TargetHeight2),
                B4 = get_block(net2_node2, TargetHeight2),
  
                %% Check that the chain merged
                ?assertEqual(B1, B2),
  