anchor.diff:      ReceivedBalance = get_balance(new_node3, PubKey1, Cfg),
       ct:log("Balance of node ~p with public key ~p is ~p", [new_node1, PubKey1, ReceivedBalance]),
       ?assertEqual(BalanceToSpend, ReceivedBalance),
  +    %% new_node1 has one spend transaction.
  +    [#{block_hash := SpendTxBlockHash, block_height := SpendTxHeight, tx := TxInfo}] =
  +        get_account_txs(new_node3, PubKey1, Cfg),
  +    ?assertEqual(ReceivedBalance, maps:get(amount, TxInfo)),
  +    ?assertEqual(Fee, maps:get(fee, TxInfo)),
  +    ?assertEqual(PubKey3, maps:get(sender, TxInfo)),
  +    ?assertEqual(PubKey1, maps:get(recipient, TxInfo)),
  +    %% Block with spend transaction has new protocol version.
  +    ?assertEqual(10, maps:get(version, get_block_by_hash(new_node3, SpendTxBlockHash, Cfg))),
       %% Sync the chain with the block that includes spend tx on new_node4.
       start_node(new_node4, Cfg),
       ok = mock_pow_on_node(new_node4, Cfg),
  -    wait_for_height_syncing(TopHeight, [new_node4], {{45000, ms}, {200, blocks}}, Cfg),
  -    #{hash := TopHash} = get_block_by_height(new_node4, TopHeight, Cfg),
  -    aest_nodes:wait_for_value({balance, PubKey1, ReceivedBalance}, [new_node4], 20000, Cfg),
  -    SyncedBalance = get_balance(new_node4, PubKey1, Cfg),
  -    ct:log("Balance of node ~p with public key ~p on synced chain on node ~p is ~p",
  -           [new_node1, PubKey1, new_node4, SyncedBalance]),
  -    ?assertEqual(ReceivedBalance, SyncedBalance),
  -    %% Check new_node4 switched to the new protocol.
  -    B4 = aest_nodes:get_top(new_node4, Cfg),
  -    ?assertEqual(10, maps:get(version, B4)),
  +    wait_for_height_syncing(SpendTxHeight, [new_node4], {{100000, ms}, {1000, blocks}}, Cfg),
  +    ?assertEqual(SpendTxBlockHash, maps:get(hash, get_block_by_height(new_node4, SpendTxHeight, Cfg))),
       ok.
   
   %=== INTERNAL FUNCTIONS ========================================================
  
positive.code:     ReceivedBalance = get_balance(new_node3, PubKey1, Cfg),
      ct:log("Balance of node ~p with public key ~p is ~p", [new_node1, PubKey1, ReceivedBalance]),
      ?assertEqual(BalanceToSpend, ReceivedBalance),
      %% Sync the chain with the block that includes spend tx on new_node4.
      start_node(new_node4, Cfg),
      ok = mock_pow_on_node(new_node4, Cfg),
      wait_for_height_syncing(TopHeight, [new_node4], {{45000, ms}, {200, blocks}}, Cfg),
      #{hash := TopHash} = get_block_by_height(new_node4, TopHeight, Cfg),
      aest_nodes:wait_for_value({balance, PubKey1, ReceivedBalance}, [new_node4], 20000, Cfg),
      SyncedBalance = get_balance(new_node4, PubKey1, Cfg),
      ct:log("Balance of node ~p with public key ~p on synced chain on node ~p is ~p",
             [new_node1, PubKey1, new_node4, SyncedBalance]),
      ?assertEqual(ReceivedBalance, SyncedBalance),
      ok.
  
  %% New node can sync the old chain from other new node and can start mining
  
negative.code:     {ok, 200, B} = aest_nodes:http_get(NodeName, int_http, [v2, block, height, Height], #{}, Cfg),
      B.
  
  get_block_by_hash(NodeName, Hash, Cfg) ->
      {ok, 200, B} = aest_nodes:http_get(NodeName, int_http, [v2, block, hash, Hash], #{}, Cfg),
      B.
  
  get_public_key(NodeName, Cfg) ->
      {ok, 200, #{pub_key := PubKey}} = aest_nodes:http_get(NodeName, int_http, [v2, account, 'pub-key'], #{}, Cfg),
      PubKey.
  