Skip to content

Commit 4ef4dfe

Browse files
committed
Merge #11847: Make boost::multi_index comparators const
1ec0c0a Make boost::multi_index comparators const (Suhas Daftuar) Pull request description: This fixes compatibility with boost 1.66. Fixes #11837 Tree-SHA512: 3181336fcc159aa7ee70c843d76f2a063e4a401f427c218d7f856a3548ca70eaf8eee9d20abb73be259a5656273d3a65aa748e946e09cf656de5f50e6d4eb880
2 parents 80f9dad + 1ec0c0a commit 4ef4dfe

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/miner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct modifiedentry_iter {
7171
// except operating on CTxMemPoolModifiedEntry.
7272
// TODO: refactor to avoid duplication of this logic.
7373
struct CompareModifiedEntry {
74-
bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b)
74+
bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b) const
7575
{
7676
double f1 = (double)a.nModFeesWithAncestors * b.nSizeWithAncestors;
7777
double f2 = (double)b.nModFeesWithAncestors * a.nSizeWithAncestors;
@@ -86,7 +86,7 @@ struct CompareModifiedEntry {
8686
// This is sufficient to sort an ancestor package in an order that is valid
8787
// to appear in a block.
8888
struct CompareTxIterByAncestorCount {
89-
bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b)
89+
bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const
9090
{
9191
if (a->GetCountWithAncestors() != b->GetCountWithAncestors())
9292
return a->GetCountWithAncestors() < b->GetCountWithAncestors();

src/txmempool.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ struct mempoolentry_txid
204204
class CompareTxMemPoolEntryByDescendantScore
205205
{
206206
public:
207-
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
207+
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
208208
{
209209
bool fUseADescendants = UseDescendantScore(a);
210210
bool fUseBDescendants = UseDescendantScore(b);
@@ -226,7 +226,7 @@ class CompareTxMemPoolEntryByDescendantScore
226226
}
227227

228228
// Calculate which score to use for an entry (avoiding division).
229-
bool UseDescendantScore(const CTxMemPoolEntry &a)
229+
bool UseDescendantScore(const CTxMemPoolEntry &a) const
230230
{
231231
double f1 = (double)a.GetModifiedFee() * a.GetSizeWithDescendants();
232232
double f2 = (double)a.GetModFeesWithDescendants() * a.GetTxSize();
@@ -241,7 +241,7 @@ class CompareTxMemPoolEntryByDescendantScore
241241
class CompareTxMemPoolEntryByScore
242242
{
243243
public:
244-
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
244+
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
245245
{
246246
double f1 = (double)a.GetModifiedFee() * b.GetTxSize();
247247
double f2 = (double)b.GetModifiedFee() * a.GetTxSize();
@@ -255,7 +255,7 @@ class CompareTxMemPoolEntryByScore
255255
class CompareTxMemPoolEntryByEntryTime
256256
{
257257
public:
258-
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
258+
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
259259
{
260260
return a.GetTime() < b.GetTime();
261261
}
@@ -264,7 +264,7 @@ class CompareTxMemPoolEntryByEntryTime
264264
class CompareTxMemPoolEntryByAncestorFee
265265
{
266266
public:
267-
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
267+
bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
268268
{
269269
double aFees = a.GetModFeesWithAncestors();
270270
double aSize = a.GetSizeWithAncestors();

0 commit comments

Comments
 (0)