From 922adf66ac7420e21ea171d3586ea84554e5d91b Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 24 Jun 2025 02:49:31 +0200 Subject: [PATCH] mempool: use `FeeFrac` for calculating regular score --- src/txmempool.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/txmempool.h b/src/txmempool.h index 466792a1e6..83926927cd 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -126,9 +126,9 @@ class CompareTxMemPoolEntryByScore public: bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const { - double f1 = (double)a.GetFee() * b.GetTxSize(); - double f2 = (double)b.GetFee() * a.GetTxSize(); - if (f1 == f2) { + FeeFrac f1(a.GetFee(), a.GetTxSize()); + FeeFrac f2(b.GetFee(), b.GetTxSize()); + if (FeeRateCompare(f1, f2) == 0) { return b.GetTx().GetHash() < a.GetTx().GetHash(); } return f1 > f2;