fixed an incompatibility with modern compilers

(pulled from upstream changes)
This commit is contained in:
Brannon King 2019-08-21 14:16:34 -06:00
parent d712d342a9
commit c123b77419

View file

@ -155,7 +155,7 @@ struct update_descendant_state
modifySize(_modifySize), modifyFee(_modifyFee), modifyCount(_modifyCount)
{}
void operator() (CTxMemPoolEntry &e)
void operator() (CTxMemPoolEntry &e) const
{ e.UpdateDescendantState(modifySize, modifyFee, modifyCount); }
private:
@ -170,7 +170,7 @@ struct update_ancestor_state
modifySize(_modifySize), modifyFee(_modifyFee), modifyCount(_modifyCount), modifySigOps(_modifySigOps)
{}
void operator() (CTxMemPoolEntry &e)
void operator() (CTxMemPoolEntry &e) const
{ e.UpdateAncestorState(modifySize, modifyFee, modifyCount, modifySigOps); }
private:
@ -184,7 +184,7 @@ struct update_fee_delta
{
update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { }
void operator() (CTxMemPoolEntry &e) { e.UpdateFeeDelta(feeDelta); }
void operator() (CTxMemPoolEntry &e) const { e.UpdateFeeDelta(feeDelta); }
private:
int64_t feeDelta;
@ -194,7 +194,7 @@ struct update_lock_points
{
update_lock_points(const LockPoints& _lp) : lp(_lp) { }
void operator() (CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); }
void operator() (CTxMemPoolEntry &e) const { e.UpdateLockPoints(lp); }
private:
const LockPoints& lp;
@ -217,7 +217,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);
@ -239,7 +239,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();
@ -254,7 +254,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();
@ -268,7 +268,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();
}
@ -277,7 +277,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();