anchor.diff:           handle_sync_event/4, terminate/3]).
   
   %% States
  --export([check_clock/2, get_txs_to_check/2, check_committing/2, commit_notification/2, 
  -commit_ts_notification/2, check_prepared/2, commit_notification2/2, return/2]).
  +-export([check_clock/2,
  +	 get_txs_to_check/2,
  +	 commit_notification/2, 
  +	 return/2]).
   
   %% Spawn
  --export([bcast_get_commit_ts/2]).
   
   -record(state, {type,
   		key,
   	 	tx,
   		client,
   		vnode,
  -        committing_txs,
  -		left_committing,
  -		prepared_txs,
  -		left_prepared,
  -		left_acks}).
  +		pending_txs}).
   
   %%%===================================================================
   %%% API
  
positive.code: 		key=Key,
                  client=Client, 
                  tx=Tx,
  		committing_txs=[],
  		left_committing=[],
  		prepared_txs=[],
  		left_prepared=[]},
      {ok, check_clock, SD, 0}.
  
  check_clock(timeout, SD0=#state{tx=Tx}) ->
  
negative.code:     end,
      {next_state, get_txs_to_check, SD0, 0}.
  
  get_txs_to_check(timeout, SD0=#state{tx=Tx, vnode=Vnode}) ->
      T_snapshot_time = Tx#tx.snapshot_time,
      %Concurrent txs
      case riak_core_vnode_master:sync_command(Vnode, {get_pending_txs, T_snapshot_time}, ?CLOCKSIMASTER) of
      {ok, empty} ->
  	{next_state, return, SD0};
      {ok, Pending} ->
      %{Committing, Pendings} = pending_commits(T_snapshot_time, Txprimes),
          {next_state, commit_notification, SD0=#state{pending_txs=Pending}, 0};
      {error, _Reason} ->
  	{stop, noraml, SD0}
      end.
  
  commit_notification({committed, TxId}, SD0=#state{pending_txs=Left}) ->
      Left2=clean_left(TxId, Left),
      if Left2==[] ->
      	{next_state, return, SD0=#state{pending_txs=Left2}, 0};
      true->
      	{next_state, commit_notification, SD0=#state{pending_txs=Left2}}
      end.
  
  return(timeout, SD0=#state{client=Client, tx= Tx, key=Key, type=Type}) ->
  