From 01d05a685249a2802ce01c549f2a4e4705b005f8 Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Sat, 24 Nov 2018 22:46:39 +0100 Subject: [PATCH] Make boost::multi_index comparators const --- src/miner.h | 4 ++-- src/txmempool.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/miner.h b/src/miner.h index 57dceba96..927ddae07 100644 --- a/src/miner.h +++ b/src/miner.h @@ -73,7 +73,7 @@ struct modifiedentry_iter { // except operating on CTxMemPoolModifiedEntry. // TODO: refactor to avoid duplication of this logic. struct CompareModifiedEntry { - bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b) + bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b) const { double f1 = (double)a.nModFeesWithAncestors * b.nSizeWithAncestors; double f2 = (double)b.nModFeesWithAncestors * a.nSizeWithAncestors; @@ -88,7 +88,7 @@ struct CompareModifiedEntry { // This is sufficient to sort an ancestor package in an order that is valid // to appear in a block. struct CompareTxIterByAncestorCount { - bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) + bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const { if (a->GetCountWithAncestors() != b->GetCountWithAncestors()) return a->GetCountWithAncestors() < b->GetCountWithAncestors(); diff --git a/src/txmempool.h b/src/txmempool.h index 6c1256be1..5448209a7 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -283,7 +283,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();