anchor.diff:  -export([start_link/1]).
   -export([init/1, handle_event/3, handle_sync_event/4,
            handle_info/3, terminate/3, code_change/4]).
  --export([active/2,merk_waiting/2,waiting_diffobjs/2]).
  --export([active/3,merk_waiting/3,waiting_diffobjs/3]).
  +-export([active/2,active/3]).
   
   -define(TIMEOUT, 60000).
   
  --record(state, {idx,mapcache,mod,modstate,waiting_diffobjs}).
  -
  -start_link(Idx) ->
  -    gen_fsm:start_link(?MODULE, [Idx], []).
  +-record(state, {idx,mapcache,mod,modstate}).
  +
  +start_link(Idx) -> gen_fsm:start_link(?MODULE, [Idx], []).
   
   init([VNodeIndex]) ->
       Mod = riak:get_app_env(storage_backend),
  
positive.code:     end.
  
  %% @private
  get_merkle(_State=#state{mod=Mod,modstate=ModState}) ->
      KeyList = Mod:list(ModState),
      Merk0 = merkerl:build_tree([]),
      get_merk(Mod,ModState,KeyList,Merk0).
  %% @private
  get_merk(_Mod,_ModState,[],Merk) -> Merk;
  get_merk(Mod,ModState,[BKey|KeyList],Merk) ->
      V = Mod:get(ModState,BKey), % normally, V = {ok,BinObj}
      get_merk(Mod,ModState,KeyList,merkerl:insert({BKey,erlang:phash2(V)},Merk)).
  
  %% @private
  get_vclocks(KeyList,_State=#state{mod=Mod,modstate=ModState}) ->
      [{BKey, get_vclock(BKey,Mod,ModState)} || BKey <- KeyList].
  %% @private
  
negative.code:     end.
  
  %% @private
  syntactic_put_merge(Mod, ModState, BKey, Obj1, ReqId) ->
      case Mod:get(ModState, BKey) of
          {error, notfound} -> {newobj, Obj1};
  