anchor.diff:      end;
   handle_info({connected, Pid, Err = {error, _}}, S = #{ status := {connecting, Pid}}) ->
       lager:debug("ZZPC: failed to connected to ~p: ~p", [{maps:get(host, S), maps:get(port, S)}, Err]),
  -    case aec_peers:connect_fail(peer_id(S), self()) of
  -        keep ->
  -            {noreply, S#{ status := error }};
  -        close ->
  -            {stop, normal, S}
  -    end;
  +    connect_fail(S);
   handle_info({connected, Pid, {ok, TcpSock}}, S0 = #{ status := {connecting, Pid} }) ->
       S = #{ version := Version, genesis := Genesis,
          seckey := SecKey, pubkey := PubKey, r_pubkey := RemotePub } = ensure_genesis(S0),
  
positive.code:     end,
      drop_request(S, send_tx).
  
  
  send_msg(#{ status := {connected, ESock} }, Type, Msg) when is_binary(Msg) ->
      enoise:send(ESock, <<Type:16, Msg/binary>>);
  send_msg(#{ status := {connected, ESock} }, Type, Msg0) ->
      Msg = <<Type:16, (msgpack:pack(Msg0))/binary>>,
      enoise:send(ESock, Msg).
  
  
  peer_id(#{ r_pubkey := PK, host := H, port := P }) when is_binary(H) ->
      <<PK/binary, P:16, H/binary>>;
  
negative.code: -include("common.hrl").
  -include("blocks.hrl").
  
  -define(MSG_FRAGMENT, 0).
  -define(MSG_PING, 1).
  -define(MSG_PING_RSP, 2).
  -define(MSG_GET_HEADER_BY_HASH, 3).
  