anchor.diff:  %%%=============================================================================
   %%% Internal functions
   %%%=============================================================================
  +
  +maybe_add_monitor(#peer{connection = {_, Pid}} = Peer, #state{peer_monitors = PMons}) ->
  +    case ets:lookup(PMons, Pid) =:= [] of
  +        true ->
  +            Ref = monitor(process, Pid),
  +            PeerId = peer_id(Peer),
  +            ets:insert(PMons, [{Pid, Ref, PeerId}]),
  +            ok;
  +        false ->
  +            ok
  +    end;
  +maybe_add_monitor(#peer{}, #state{}) ->
  +    ok.
   
   metrics(#state{peers = Peers, blocked = Blocked} = State) ->
       aec_metrics:try_update([ae,epoch,aecore,peers,count],
  
positive.code: -record(state, {peers                   :: gb_trees:tree(binary(), peer()),
                  blocked = gb_sets:new() :: gb_sets:set(peer_id()),
                  local_peer              :: peer_info(),  %% for universal handling of URIs
                  next_unblock = 0        :: integer() %% Erlang timestamp in ms.
                 }).
  
  start_link() ->
  
negative.code:     {ok, SecKey} = aec_keys:peer_privkey(),
      {ok, PubKey} = aec_keys:peer_pubkey(),
      LocalPeer = #{seckey => SecKey, pubkey => PubKey},
      PMons = ets:new(aec_peer_monitors, [named_table, protected]),
      lager:info("aec_peers started at ~p", [LocalPeer]),
      {ok, #state{peers = gb_trees:empty(),
                  local_peer = LocalPeer,
                  peer_monitors = PMons
                 }}.
  
  handle_call({set_local_peer_info, Peer}, _From, State) ->
      {reply, ok, State#state{local_peer = Peer}};
  