anchor.diff:  p_process_tree_cmp_result([?ok_leaf | TR], [_Node | TN], BS, Stats, Req, Res, RTree) ->
       NStats = rr_recon_stats:inc([{tree_compareSkipped, 1}], Stats),
       p_process_tree_cmp_result(TR, TN, BS, NStats, Req, Res, RTree);
  -p_process_tree_cmp_result([?fail_leaf | TR], [Node | TN], BS, Stats, Req, Res, RTree) ->
  -    p_process_tree_cmp_result(TR, TN, BS, Stats, Req, [Node | Res], RTree);
  +p_process_tree_cmp_result([{?fail_leaf, Hash} | TR], [Node | TN], BS, Stats, Req, Res, RTree) ->
  +    NewRes = lists:append(merkle_get_sync_leafs([Node], Hash, []), Res),
  +    p_process_tree_cmp_result(TR, TN, BS, Stats, Req, NewRes, RTree);
   p_process_tree_cmp_result([?fail_inner | TR], [Node | TN], BS, Stats, Req, Res, RTree) ->
       case merkle_tree:is_leaf(Node) of
           false -> 
  
positive.code: %% merkle tree sync messages
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  on({check_nodes, SenderPid, ToCheck}, State = #rr_recon_state{struct = Tree}) ->
      {Result, RestTree} = check_node(ToCheck, Tree),
      send(SenderPid, {check_nodes_response, Result}),
      State#rr_recon_state{dest_recon_pid = SenderPid, struct = RestTree};
  
  on({check_nodes, ToCheck},
     State = #rr_recon_state{struct = Tree, dest_recon_pid = SenderPid}) ->
      ?ASSERT(comm:is_valid(SenderPid)),
      {Result, RestTree} = check_node(ToCheck, Tree),
      send(SenderPid, {check_nodes_response, Result}),
      State#rr_recon_state{struct = RestTree};
  
  on({check_nodes_response, CmpResults}, State =
         #rr_recon_state{ dest_recon_pid = DestReconPid,
  
negative.code:                                       Res,
                                        lists:reverse(Childs, RTree));
          true -> 
              NewReq = [{BS, merkle_tree:get_hash(Node)} | Req],
              p_process_tree_cmp_result(TR, TN, BS, Stats, NewReq, [Node | Res], RTree)
      end.
  
  %% @doc Gets all leaves in the given merkle node list whose hash =/= skipHash. 
  -spec merkle_get_sync_leafs(Nodes::NodeL, Skip::Hash, LeafAcc::NodeL) -> ToSync::NodeL 
      when 
        is_subtype(Hash,  merkle_tree:mt_node_key()),
        is_subtype(NodeL, [merkle_tree:mt_node()]).
  merkle_get_sync_leafs([], _Skip, ToSyncAcc) ->
      ToSyncAcc;
  merkle_get_sync_leafs([Node | Rest], Skip, ToSyncAcc) ->
      case merkle_tree:is_leaf(Node) of
          true  ->
              case merkle_tree:get_hash(Node) =:= Skip of
                  true  -> merkle_get_sync_leafs(Rest, Skip, ToSyncAcc);
                  false -> merkle_get_sync_leafs(Rest, Skip, [Node | ToSyncAcc])
              end;
          false ->
              merkle_get_sync_leafs(
                lists:append(merkle_tree:get_childs(Node), Rest), Skip, ToSyncAcc)
      end.
  
  %% @doc Starts a single resolve request for all given leave nodes by joining
  %%      their intervals.
  %%      Returns the number of resolve requests (requests with feedback count 2).
  -spec resolve_leafs([merkle_tree:mt_node()], Dest::comm:mypid(),
                       rrepair:session_id(), OwnerLocal::comm:erl_local_pid())
          -> 0..2.
  resolve_leafs([], _Dest, _SID, _OwnerL) -> 0;
  resolve_leafs(Nodes, Dest, SID, OwnerL) ->
      resolve_leafs(Nodes, Dest, SID, OwnerL, intervals:empty(), 0).
  
  % @doc Returns number of caused resolve requests (requests with feedback count 2).
  -spec resolve_leafs([merkle_tree:mt_node()], Dest::comm:mypid(),
                       rrepair:session_id(), OwnerLocal::comm:erl_local_pid(),
                       Interval::intervals:interval(), Items::non_neg_integer())
          -> 0..2.
  resolve_leafs([Node | Rest], Dest, SID, OwnerL, Interval, Items) ->
      LeafInterval = merkle_tree:get_interval(Node),
      IntervalNew = intervals:union(Interval, LeafInterval),
      ItemsNew = Items + merkle_tree:get_item_count(Node),
      resolve_leafs(Rest, Dest, SID, OwnerL, IntervalNew, ItemsNew);
  resolve_leafs([], Dest, SID, OwnerL, Interval, Items) ->
      Options = [{feedback_request, comm:make_global(OwnerL)}],
      case intervals:is_empty(Interval) of
          true -> 0;
  