anchor.diff:      end.
   
   %% @doc Trigger operations for the DHT.
  --spec initiate_rdht_ops([request_on_key()]) -> [{req_id(), request_on_key()}].
  +-spec initiate_rdht_ops([request_on_key()]) -> [req_id()].
   initiate_rdht_ops(ReqList) ->
       ?TRACE("rdht_tx:initiate_rdht_ops(~p)~n", [ReqList]),
       %% @todo should choose a dht_node in the local VM at random or even
  
positive.code: 
      %% perform RDHT operations to collect missing TLog entries
      %% rdht requests for independent keys are processed in parallel.
      ReqListWithReqIds = initiate_rdht_ops(ReqListonRDHT),
  
      RTLog = collect_replies(tx_tlog:empty(), ReqListWithReqIds),
  
      %% merge TLogs (insert fail, abort, when version mismatch
      %% in reads for same key is detected)
  
negative.code:               rdht_tx_write ->
                    rdht_tx_write:work_phase(self(), NewReqId, Entry)
            end,
            NewReqId
        end || Entry <- ReqList ].
  
  %% @doc Collect replies from the quorum DHT operations.
  -spec collect_replies(tx_tlog:tlog(), [req_id()]) -> tx_tlog:tlog().
  collect_replies(TLog, [ReqId | RestReqIds] = _ReqIdsList) ->
      ?TRACE("rdht_tx:collect_replies(~p, ~p)~n", [TLog, _ReqIdsList]),
      % receive only matching replies
      RdhtTlogEntry = receive_answer(ReqId),
      NewTLog = [RdhtTlogEntry | TLog],
      collect_replies(NewTLog, RestReqIds);
  collect_replies(TLog, []) ->
      %% Drop outdated results...
      receive_old_answers(),
      tx_tlog:sort_by_key(TLog).
  
  %% @doc Merge TLog entries, if same key. Check for version mismatch,
  %%      take over values.
  