anchor.diff:  -spec fold_fun(pid(), boolean()) -> fun().
   fold_fun(HashtreePid, _HasIndexTree = false) ->
       ObjectFoldFun = object_fold_fun(HashtreePid),
  -    {Limit, Wait} = get_build_throttle(),
  -    fun(BKey, RObj, Acc) ->
  +    fun(BKey, RObj, {Acc, {Limit, Wait}}) ->
               BinBKey = term_to_binary(BKey),
               ObjectFoldFun(BKey, RObj, BinBKey),
               Acc2 = maybe_throttle_build(RObj, Limit, Wait, Acc),
  
positive.code:     if (Limit =/= 0) andalso (Acc2 > Limit) ->
              lager:debug("Throttling AAE build for ~b ms", [Wait]),
              timer:sleep(Wait),
              0;
         true ->
              Acc2
      end.
  
  %% @doc Generate the folding function
  
negative.code: 
  %% The accumulator in the fold is the number of bytes hashed
  %% modulo the "build limit" size. If we get an int back, everything is ok
  handle_fold_keys_result({Result, {_Limit, _Delay}}, HashtreePid, Index) when is_integer(Result) ->
      lager:info("Finished AAE tree build: ~p", [Index]),
      gen_server:cast(HashtreePid, build_finished);
  handle_fold_keys_result(Result, HashtreePid, Index) ->
      lager:error("Failed to build hashtree for index ~p. Result was: ~p", [Index, Result]),
      gen_server:cast(HashtreePid, build_failed).
  
  