anchor.diff:              %% In the future, we will handle this using msg_delay for
               %% outstanding txids to trigger a delete of the items.
       end,
  -    State;
  +    NewState;
   
   %% generated by on(register_TP) via msg_delay to not increase memory
   %% footprint
  
positive.code:     %% process hold back messages for tx_state
      %% @TODO better use a foldr
      %% io:format("Starting hold back queue processing~n"),
      _ = [ on(OldMsg, State) || OldMsg <- lists:reverse(tx_state:get_hold_back(NewEntry)) ],
      %% process hold back messages for tx_items
      _ = [ [ on(OldMsg, State)
          || OldMsg <- lists:reverse(tx_item_state:get_hold_back(Item)) ]
        || Item <- NewItemStates],
      %% io:format("Stopping hold back queue processing~n"),
  
negative.code:     %% lookup transaction id locally and merge with given TxState
      Tid = tx_state:get_tid(TxState),
      {LocalTxStatus, LocalTxEntry} = my_get_tx_entry(Tid, State),
      {TmpEntry, NewState} =
          case LocalTxStatus of
              new ->
                  TmpState = state_subscribe(State, tx_state:get_tm(TxState)),
                  {TxState, TmpState}; %% nothing known locally
              uninitialized ->
                  %% take over hold back from existing entry
                  %%io:format("initRTM takes over hold back queue for id ~p in ~p~n", [Tid, Role]),
                  HoldBackQ = tx_state:get_hold_back(LocalTxEntry),
                  {tx_state:set_hold_back(TxState, HoldBackQ), State};
              ok ->
                  log:log(error, "Duplicate init_RTM", []),
                  {LocalTxEntry, State}
          end,
      NewEntry = tx_state:set_status(TmpEntry, ok),
      _ = my_set_entry(NewEntry, NewState),
  
      %% lookup items locally and merge with given ItemStates
      NewItemStates =
          [ begin
                EntryId = tx_item_state:get_itemid(Entry),
                {LocalItemStatus, LocalItem} = my_get_item_entry(EntryId, NewState),
                TmpItem = case LocalItemStatus of
                              new -> Entry; %% nothing known locally
                              uninitialized ->
  