We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FeeFrac
1 parent 3322b3a commit 922adf6Copy full SHA for 922adf6
src/txmempool.h
@@ -126,9 +126,9 @@ class CompareTxMemPoolEntryByScore
126
public:
127
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
128
{
129
- double f1 = (double)a.GetFee() * b.GetTxSize();
130
- double f2 = (double)b.GetFee() * a.GetTxSize();
131
- if (f1 == f2) {
+ FeeFrac f1(a.GetFee(), a.GetTxSize());
+ FeeFrac f2(b.GetFee(), b.GetTxSize());
+ if (FeeRateCompare(f1, f2) == 0) {
132
return b.GetTx().GetHash() < a.GetTx().GetHash();
133
}
134
return f1 > f2;
0 commit comments