anchor.diff:  %% remove_transport
   shutdown(Refs, #state{watchdogT = WatchdogT})
     when is_list(Refs) ->
  -    ets:foldl(fun(P,ok) -> st(P, Refs), ok end, ok, WatchdogT);
  +    ets:insert(WatchdogT, ets:foldl(fun(R,A) -> st(R, Refs, A) end,
  +                                    [],
  +                                    WatchdogT));
   
   %% application/service shutdown
   shutdown(Reason, #state{watchdogT = WatchdogT})
     when Reason == application;
          Reason == service ->
  -    diameter_lib:wait(ets:foldl(fun(P,A) -> st(P, Reason, A) end,
  +    diameter_lib:wait(ets:foldl(fun(P,A) -> ss(P, Reason, A) end,
                                   [],
                                   WatchdogT)).
   
  -%% st/2
  -
  -st(#watchdog{ref = Ref, pid = Pid}, Refs) ->
  -    lists:member(Ref, Refs)
  -        andalso (Pid ! {shutdown, self(), transport}).  %% 'DOWN' cleans up
  -
   %% st/3
   
  -st(#watchdog{pid = Pid}, Reason, Acc) ->
  +%% Mark replacement as started so that a subsequent accept doesn't
  +%% result in a new process that isn't terminated.
  +st(#watchdog{ref = Ref, pid = Pid, peer = P} = Rec, Refs, Acc) ->
  +    case lists:member(Ref, Refs) of
  +        true ->
  +            Pid ! {shutdown, self(), transport},  %% 'DOWN' cleans up
  +            [Rec#watchdog{peer = true} || P == false] ++ Acc;
  +        false ->
  +            Acc
  +    end.
  +
  +%% ss/3
  +
  +ss(#watchdog{pid = Pid}, Reason, Acc) ->
       MRef = monitor(process, Pid),
       Pid ! {shutdown, self(), Reason},
       [MRef | Acc].
  
positive.code: tc_timeout({Ref, _Type, _Opts} = T, #state{service_name = SvcName} = S) ->
      tc(diameter_config:have_transport(SvcName, Ref), T, S).
  
  tc(true, {Ref, Type, Opts}, #state{service_name = SvcName}
                              = S) ->
      send_event(SvcName, {reconnect, Ref, Opts}),
      start(Ref, Type, Opts, S);
  tc(false = No, _, _) ->  %% removed
  
negative.code:          state = ?WD_INITIAL :: match(wd_state()),
           started = diameter_lib:now(),%% at process start
           peer = false :: match(boolean() | pid())}).
                        %% true at accepted/remove, pid() at okay/reopen
  
  %% Record representing a Peer State Machine processes implemented by
  %% diameter_peer_fsm.
  