anchor.diff:      TRef = send_request(TPid, Pkt, Req, SvcName, Tmo),
       {TRef, Req}.
   
  -%% store_request/2
  -
  -store_request(T, TPid) ->
  -    ets:insert(?REQUEST_TABLE, T),
  -    ets:member(?REQUEST_TABLE, TPid)
  -        orelse begin
  -                   {_Seqs, _Req, TRef} = T,
  -                   self() ! {failover, TRef}  %% failover/1 may have missed
  -               end.
  +%% insert_request/1
  +
  +insert_request({_Seqs, #request{transport = TPid}, TRef} = T) ->
  +    ets:insert(?REQUEST_TABLE, [T, {TPid, {self(), TRef}}]),
  +    is_peer_up(TPid)
  +        orelse (self() ! {failover, TRef}).  %% failover/1 may have missed
  +
  +%% is_peer_up/1
  +%%
  +%% Is the entry written by peer_up/1 and deleted by peer_down/1 still
  +%% in the request table?
  +
  +is_peer_up(TPid) ->
  +    Spec = [{{TPid}, [], ['$_']}],
  +    '$end_of_table' /= ets:select(?REQUEST_TABLE, Spec, 1).
   
   %% lookup_request/2
   %%
  
positive.code: make_request_packet(Msg, Pkt) ->
      Pkt#diameter_packet{msg = Msg}.
  
  %% make_retransmit_packet/2
  
  make_retransmit_packet(#diameter_packet{msg = [#diameter_header{} = Hdr
                                                 | Avps]}
  
negative.code:   when node() == node(TPid) ->
      Seqs = diameter_codec:sequence_numbers(Bin),
      TRef = erlang:start_timer(Timeout, self(), TPid),
      Entry = {Seqs, #request{handler = Pid} = Req, TRef},
  
      %% Ensure that request table is cleaned even if the process is
      %% killed.
      spawn(fun() -> diameter_lib:wait([Pid]), delete_request(Entry) end),
  
      insert_request(Entry),
      send(TPid, Pkt),
      TRef;
  
  