anchor.diff:          StatsPerTransfer#{TransferId => NewTransferStats}
       end, State#state.cached_stats, TransferIds),
   
  +    NewCachedBlocks = lists:foldl(fun(From, Acc) ->
  +        FromBlocks = maps:get(From, Acc, []),
  +        maps:put(From, [Block | FromBlocks], Acc)
  +    end, State#state.cached_blocks, AffectedFroms),
  +
       NewState = State#state{
           cached_stats = UpdatedStats,
  -        cached_blocks = [Block | State#state.cached_blocks]
  +        cached_blocks = NewCachedBlocks
       },
       set_caching_timers(NewState).
   
  
positive.code:         end
      end, {[], FS}, FinishedFroms),
  
      {Location, State2} = flush_blocks(State1, ExcludeSessions),
      % Transfer on the fly statistics are being kept under `undefined` key in
      % `state.cached_stats` map, so take it from it and flush only jobs stats;
      % on the lfy transfer stats are flushed only on cache timer timeout
  
negative.code:         [] -> [undefined];
          Values -> Values
      end,
      {noreply, cache_stats_and_blocks(AffectedFroms, TransferIds, ProviderId,
          Block, State), ?DIE_AFTER};
  
  handle_info(?FLUSH_STATS, State) ->
      {noreply, flush_stats(State, true), ?DIE_AFTER};
  
  handle_info(?FLUSH_BLOCKS, State) ->
      {_, State2} = flush_blocks(State, [], []),
      {noreply, flush_events(State2), ?DIE_AFTER};
  
  handle_info(?FLUSH_EVENTS, State) ->
      {noreply, flush_events(State), ?DIE_AFTER};
  