MCPcopy Create free account
hub / github.com/ElementsProject/elements / CompareTxMemPoolEntryByScore

Class CompareTxMemPoolEntryByScore

src/txmempool.h:256–268  ·  view source on GitHub ↗

\class CompareTxMemPoolEntryByScore * * Sort by feerate of entry (fee/size) in descending order * This is only used for transaction relay, so we use GetFee() * instead of GetModifiedFee() to avoid leaking prioritization * information via the sort order. */

Source from the content-addressed store, hash-verified

254 * information via the sort order.
255 */
256class CompareTxMemPoolEntryByScore
257{
258public:
259 bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
260 {
261 double f1 = (double)a.GetFee() * b.GetTxSize();
262 double f2 = (double)b.GetFee() * a.GetTxSize();
263 if (f1 == f2) {
264 return b.GetTx().GetHash() < a.GetTx().GetHash();
265 }
266 return f1 > f2;
267 }
268};
269
270class CompareTxMemPoolEntryByEntryTime
271{

Callers 2

CompareDepthAndScoreMethod · 0.85
operator()Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected