anchor.diff:      [L ++ [stats([P], Stats)] || L <- ConnL, {peer, {P,_}} <- L].
   
   conn_list(S) ->
  -    lists:append(dict:fold(fun conn_acc/3, [], peer_dict(S))).
  +    lists:append(dict:fold(fun conn_acc/3, [], peer_dict(S, dict:new()))).
   
   conn_acc(Ref, Peers, Acc) ->
       [[[{ref, Ref} | L] || L <- Peers, lists:keymember(peer, 1, L)]
  
positive.code: info_conn(_, _, _) ->
      [].
  
  wd_state({_,S}) ->
      S;
  wd_state(?STATE_UP) ->
  
negative.code:               [],
                PeerD).
  
  %% Only a config entry for a listening transport: use it.
  transport([[{type, listen}, _] = L]) ->
      L ++ [{accept, []}];
  
  %% Only one config or peer entry for a connecting transport: use it.
  transport([[{type, connect} | _] = L]) ->
      L;
  
  %% Peer entries: discard config. Note that the peer entries have
  %% length at least 3.
  transport([[_,_] | L]) ->
      transport(L);
  
  %% Possibly many peer entries for a listening transport. Note that all
  %% have the same options by construction, which is not terribly space
  %% efficient. (TODO: all entries for the same Ref should share options.)
  transport([[{type, accept}, {options, Opts} | _] | _] = Ls) ->
      [{type, listen},
       {options, Opts},
       {accept, [lists:nthtail(2,L) || L <- Ls]}].
  
  peer_dict(#state{peerT = PeerT, connT = ConnT}, Dict0) ->
      ets:foldl(fun(T,A) -> peer_acc(ConnT, A, T) end, Dict0, PeerT).
  
  peer_acc(ConnT, Acc, #peer{pid = Pid,
                             type = Type,
  