diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2017-12-07 09:57:53 -0500 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2017-12-27 21:36:21 +0800 |
commit | ad8393634a7b86a1da40f4d2533b16b69c0dd26c (patch) | |
tree | f580d39db4d71172fba1a3b8b4732aec42741252 /src/txmempool.h | |
parent | 2559a19e6fdb91cd69b05ac3e8aed91c3be8882c (diff) | |
download | bitcoin-ad8393634a7b86a1da40f4d2533b16b69c0dd26c.tar.xz |
Make boost::multi_index comparators const
GitHub-Pull: #11847
Rebased-From: 1ec0c0a
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/txmempool.h b/src/txmempool.h index 6723ea8e6c..64f11d85bf 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -207,7 +207,7 @@ struct mempoolentry_txid class CompareTxMemPoolEntryByDescendantScore { public: - bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) + bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const { bool fUseADescendants = UseDescendantScore(a); bool fUseBDescendants = UseDescendantScore(b); @@ -229,7 +229,7 @@ public: } // Calculate which score to use for an entry (avoiding division). - bool UseDescendantScore(const CTxMemPoolEntry &a) + bool UseDescendantScore(const CTxMemPoolEntry &a) const { double f1 = (double)a.GetModifiedFee() * a.GetSizeWithDescendants(); double f2 = (double)a.GetModFeesWithDescendants() * a.GetTxSize(); @@ -244,7 +244,7 @@ public: class CompareTxMemPoolEntryByScore { public: - bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) + bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const { double f1 = (double)a.GetModifiedFee() * b.GetTxSize(); double f2 = (double)b.GetModifiedFee() * a.GetTxSize(); @@ -258,7 +258,7 @@ public: class CompareTxMemPoolEntryByEntryTime { public: - bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) + bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const { return a.GetTime() < b.GetTime(); } @@ -267,7 +267,7 @@ public: class CompareTxMemPoolEntryByAncestorFee { public: - bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) + bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const { double aFees = a.GetModFeesWithAncestors(); double aSize = a.GetSizeWithAncestors(); |