| 
    rippled
    
   | 
 
Represents a transaction in the queue which may be applied later to the open ledger. More...

Public Member Functions | |
| MaybeTx (std::shared_ptr< STTx const > const &, TxID const &txID, FeeLevel64 feeLevel, ApplyFlags const flags, PreflightResult const &pfresult) | |
| Constructor.   | |
| ApplyResult | apply (Application &app, OpenView &view, beast::Journal j) | 
| Attempt to apply the queued transaction to the open ledger.   | |
| TxConsequences const & | consequences () const | 
| Potential TxConsequences of applying this transaction to the open ledger.   | |
| TxDetails | getTxDetails () const | 
| Return a TxDetails based on contained information.   | |
Public Attributes | |
| boost::intrusive::set_member_hook | byFeeListHook | 
| Used by the TxQ::FeeHook and TxQ::FeeMultiSet below to put each MaybeTx object into more than one set without copies, pointers, etc.   | |
| std::shared_ptr< STTx const > | txn | 
| The complete transaction.   | |
| FeeLevel64 const | feeLevel | 
| Computed fee level that the transaction will pay.   | |
| TxID const | txID | 
| Transaction ID.   | |
| AccountID const | account | 
| Account submitting the transaction.   | |
| std::optional< LedgerIndex > const | lastValid | 
Expiration ledger for the transaction (sfLastLedgerSequence field).   | |
| SeqProxy const | seqProxy | 
Transaction SeqProxy number (sfSequence or sfTicketSequence field).   | |
| int | retriesRemaining | 
| A transaction at the front of the queue will be given several attempts to succeed before being dropped from the queue.   | |
| ApplyFlags const | flags | 
Flags provided to apply.   | |
| std::optional< TER > | lastResult | 
| If the transactor attempted to apply the transaction to the open ledger from the queue and failed, then this is the transactor result from the last attempt.   | |
| std::optional< PreflightResult const > | pfresult | 
Cached result of the preflight operation.   | |
Static Public Attributes | |
| static constexpr int | retriesAllowed = 10 | 
| Starting retry count for newly queued transactions.   | |
| static LedgerHash | parentHashComp {} | 
| The hash of the parent ledger.   | |
Represents a transaction in the queue which may be applied later to the open ledger.
| ripple::TxQ::MaybeTx::MaybeTx | ( | std::shared_ptr< STTx const > const & | txn_, | 
| TxID const & | txID, | ||
| FeeLevel64 | feeLevel, | ||
| ApplyFlags const | flags, | ||
| PreflightResult const & | pfresult | ||
| ) | 
| ApplyResult ripple::TxQ::MaybeTx::apply | ( | Application & | app, | 
| OpenView & | view, | ||
| beast::Journal | j | ||
| ) | 
| TxConsequences const & ripple::TxQ::MaybeTx::consequences | ( | ) | const | 
Potential TxConsequences of applying this transaction to the open ledger.
| TxDetails ripple::TxQ::MaybeTx::getTxDetails | ( | ) | const | 
| boost::intrusive::set_member_hook ripple::TxQ::MaybeTx::byFeeListHook | 
Used by the TxQ::FeeHook and TxQ::FeeMultiSet below to put each MaybeTx object into more than one set without copies, pointers, etc.
| std::shared_ptr<STTx const> ripple::TxQ::MaybeTx::txn | 
| FeeLevel64 const ripple::TxQ::MaybeTx::feeLevel | 
| TxID const ripple::TxQ::MaybeTx::txID | 
Transaction ID.
| AccountID const ripple::TxQ::MaybeTx::account | 
| std::optional<LedgerIndex> const ripple::TxQ::MaybeTx::lastValid | 
| SeqProxy const ripple::TxQ::MaybeTx::seqProxy | 
Transaction SeqProxy number (sfSequence or sfTicketSequence field). 
| int ripple::TxQ::MaybeTx::retriesRemaining | 
A transaction at the front of the queue will be given several attempts to succeed before being dropped from the queue.
If dropped, one of the account's penalty flags will be set, and other transactions may have their retriesRemaining forced down as part of the penalty. 
| ApplyFlags const ripple::TxQ::MaybeTx::flags | 
| std::optional<TER> ripple::TxQ::MaybeTx::lastResult | 
If the transactor attempted to apply the transaction to the open ledger from the queue and failed, then this is the transactor result from the last attempt.
Should never be a tec, tef, tem, or tesSUCCESS, because those results cause the transaction to be removed from the queue. 
| std::optional<PreflightResult const> ripple::TxQ::MaybeTx::pfresult | 
Cached result of the preflight operation. 
Because preflight is expensive, minimize the number of times it needs to be done. 
pfresult is never allowed to be empty. The std::optional is leveraged to allow emplaced construction and replacement without a copy assignment operation. 
      
  | 
  staticconstexpr | 
Starting retry count for newly queued transactions.
In TxQ::accept, the required fee level may be low enough that this transaction gets a chance to apply to the ledger, but it may get a retry ter result for another reason (eg. insufficient balance). When that happens, the transaction is left in the queue to try again later, but it shouldn't be allowed to fail indefinitely. The number of failures allowed is essentially arbitrary. It should be large enough to allow temporary failures to clear up, but small enough that the queue doesn't fill up with stale transactions which prevent lower fee level transactions from queuing.
      
  | 
  static | 
The hash of the parent ledger.
This is used to pseudo-randomize the transaction order when populating byFee_, by XORing it with the transaction hash (txID). Using a single static and doing the XOR operation every time was tested to be as fast or faster than storing the computed "sort key", and obviously uses less memory.