rippled
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ripple::TxQ::OrderCandidates Class Reference

Used for sorting MaybeTx. More...

Public Member Functions

 OrderCandidates ()=default
 Default constructor.
 
bool operator() (MaybeTx const &lhs, MaybeTx const &rhs) const
 Sort MaybeTx by feeLevel descending, then by pseudo-randomized transaction ID ascending.
 

Detailed Description

Used for sorting MaybeTx.

Definition at line 612 of file TxQ.h.

Constructor & Destructor Documentation

◆ OrderCandidates()

ripple::TxQ::OrderCandidates::OrderCandidates ( )
explicitdefault

Default constructor.

Member Function Documentation

◆ operator()()

bool ripple::TxQ::OrderCandidates::operator() ( MaybeTx const &  lhs,
MaybeTx const &  rhs 
) const

Sort MaybeTx by feeLevel descending, then by pseudo-randomized transaction ID ascending.

The transaction queue is ordered such that transactions paying a higher fee are in front of transactions paying a lower fee, giving them an opportunity to be processed into the open ledger first. Within transactions paying the same fee, order by the arbitrary but consistent pseudo-randomized transaction ID. The ID is pseudo-randomized by XORing it with the open ledger's parent hash, which is deterministic, but unpredictable. This allows validators to build similar queues in the same order, and thus have more similar initial proposals.

Definition at line 634 of file TxQ.h.