anchor.diff:                              infinity -> infinity;
                               Retries -> Retries - 1
                           end,
  -                    transaction(Fun, R);
  +                    T = case TimeLeft of
  +                            infinity -> infinity;
  +                            TimeLeft -> TimeLeft - timer:now_diff(now(), Start)
  +                        end,
  +                    transaction(Fun, R, T, Opts);
   
                   _ : Reason ->
                       error_logger:info_msg("function threw non-lock error - ~p", [Reason]),
  
positive.code:             put_r(Db, Key, NewValue),
              NewValue
          end,
      transaction(F, infinity, Opts).
  
  
  %%--------------------------------------------------------------------
  
negative.code: 
  -type db_txn_fun() :: fun(() -> term()).
  -type db_txn_retries() :: infinity | non_neg_integer().
  -type db_txn_timeleft() :: infinity | non_neg_integer().
  -type db_txn_error() :: {error, db_error_reason() | {transaction_failed, _}}.
  
  -type db_update_fun() :: fun((db_key(), db_value(), any()) -> db_value()).
  