anchor.diff:      connect_node(net1_node2, net2, Cfg),
       connect_node(net2_node1, net1, Cfg),
       connect_node(net2_node2, net1, Cfg),
  -    T0 = msec_stamp(),
  +    T0 = erlang:system_time(millisecond),
   
       %% Mine Length blocks, this may take longer than ping interval
       %% if so, the chains should be in sync when it's done.
  -    wait_for_value({height, Length * 2}, [net1_node1, net1_node2, net2_node1, net2_node2],
  -                    Length * ?MINING_TIMEOUT, Cfg),
  +    wait_for_value({height, Length * 2}, Nodes, Length * ?MINING_TIMEOUT, Cfg),
   
       %% Wait at least as long as the ping timer can take 
  -    ?WITHIN(T0 + 2 * ping_interval(),
  -            begin
  +    try_until(T0 + 2 * ping_interval(),
  +            fun() ->
  +
                 {ok, 200, B1} = request(net1_node1, 'GetBlockByHeight', #{height => Length * 2}),
                 {ok, 200, B2} = request(net1_node2, 'GetBlockByHeight', #{height => Length * 2}),
                 {ok, 200, B3} = request(net2_node1, 'GetBlockByHeight', #{height => Length * 2}),
  
positive.code: -include_lib("eunit/include/eunit.hrl").
  
  %=== MACROS ====================================================================
  
  -define(WITHIN(Time, Code),
          try_until(Time, fun() -> Code end)).
                 
  
  -define(MINING_TIMEOUT,   2000).
  
negative.code:     Length = 10,
  
      setup_nodes([?NET1_NODE1, ?NET1_NODE2, ?NET2_NODE1, ?NET2_NODE2], Cfg),
      Nodes = [net1_node1, net1_node2, net2_node1, net2_node2],
      start_node(net1_node1, Cfg),
      start_node(net1_node2, Cfg),
      start_node(net2_node1, Cfg),
  