anchor.diff:      session_to_froms = #{} :: #{session:id() => sets:set(from())},
       from_requests_types = #{} :: #{from() => request_type()},
       from_to_transfer_id = #{} :: #{from() => transfer:id() | undefined},
  +    ref_to_transfer_ids = #{} :: #{fetch_ref() => [transfer:id()]},
       transfer_id_to_from = #{} :: #{transfer:id() | undefined => from()},
       cached_stats = #{} :: #{undefined | transfer:id() => #{od_provider:id() => integer()}},
       requested_blocks = #{} :: #{from() => block()},
  
positive.code: handle_info(timeout, State) ->
      {noreply, State, ?DIE_AFTER};
  
  handle_info({Ref, active, ProviderId, Block}, #state{
      file_ctx = FileCtx,
      ref_to_froms = RefToFroms,
      from_to_transfer_id = FromToTransferId
  } = State) ->
      fslogic_cache:set_local_change(true),
      {ok, _} = replica_updater:update(FileCtx, [Block], undefined, false),
      fslogic_cache:set_local_change(false),
      AffectedFroms = maps:get(Ref, RefToFroms, []),
      TransferIds = case maps:values(maps:with(AffectedFroms, FromToTransferId)) of
          [] -> [undefined];
          Values -> lists:usort(Values)
      end,
      {noreply, cache_stats_and_blocks(TransferIds, ProviderId, Block, State), ?DIE_AFTER};
  
  
negative.code:     TransferIdToFrom = maps:put(TransferId, From, State#state.transfer_id_to_from),
      State#state{from_to_transfer_id = FromToTransferId,
          transfer_id_to_from = TransferIdToFrom}.
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Associates a fetch ref with a transfer ids and sets timer after which
  %% msg to clear such association will be send.
  %% @end
  %%--------------------------------------------------------------------
  -spec associate_ref_with_tids(Ref :: fetch_ref(), [transfer:id()], #state{}) ->
      #state{}.
  associate_ref_with_tids(_From, [], State) -> State;
  associate_ref_with_tids(Ref, TransferIds, State) ->
      RefToTransferIds = maps:put(Ref, TransferIds, State#state.ref_to_transfer_ids),
      erlang:send_after(?REF_TO_TIDS_CLEARING_DELAY, self(), ?REF_TO_TIDS_CLEARING_MSG(Ref)),
      State#state{ref_to_transfer_ids = RefToTransferIds}.
  
  %%--------------------------------------------------------------------
  %% @private
  