Skip to content

Commit 922adf6

Browse files
committed
mempool: use FeeFrac for calculating regular score
1 parent 3322b3a commit 922adf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/txmempool.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ class CompareTxMemPoolEntryByScore
126126
public:
127127
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
128128
{
129-
double f1 = (double)a.GetFee() * b.GetTxSize();
130-
double f2 = (double)b.GetFee() * a.GetTxSize();
131-
if (f1 == f2) {
129+
FeeFrac f1(a.GetFee(), a.GetTxSize());
130+
FeeFrac f2(b.GetFee(), b.GetTxSize());
131+
if (FeeRateCompare(f1, f2) == 0) {
132132
return b.GetTx().GetHash() < a.GetTx().GetHash();
133133
}
134134
return f1 > f2;

0 commit comments

Comments
 (0)