anchor.diff:                          FoundPeer
                   end,
               State1 = State0#state{peers = enter_peer(NewPeer, State0#state.peers)},
  +            maybe_add_monitor(NewPeer, State1),
               {noreply, metrics(State1)};
           true ->
               lager:debug("Will not add peer ~p", [ppp(PeerId)]),
  
positive.code:                                 {ok, FoundPeer#peer{ connection = {connected, PeerCon} }}
                          end
                  end,
              State1 = State#state{peers = enter_peer(NewPeer, State#state.peers)},
              {reply, Res, metrics(State1)}
      end.
  
negative.code:             lager:debug("stale ping_peer timer msg (~p) - ignore", [ppp(PeerId)]),
              {noreply, State}
      end;
  handle_info({'DOWN', Ref, process, Pid, _}, #state{peer_monitors = PMons} = State) ->
      [{Pid, Ref, PeerId}] = ets:lookup(PMons, Pid),
      ets:delete(PMons, Pid),
      case lookup_peer(PeerId, State) of
          {value, _, #peer{connection = {_, Pid}}} ->
              %% This was an unexpected process down. Clean it up.
              %% TODO: This should probably be restarted.
              lager:error("Peer connection died - removing: ~p : ~p",
                          [Pid, ppp(PeerId)]),
              Peers = remove_peer(PeerId, State#state.peers),
              {noreply, State#state{peers = Peers}};
          _ ->
              %% This was a stale process monitor message
              {noreply, State}
      end;
  handle_info(_Info, State) ->
      {noreply, State}.
  
  