aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-03-21 11:37:17 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-03-21 11:38:44 +0100
commitfa8857c3f7863d5cfa9a9e62db7f95aad80ea48e (patch)
treed7e34e8caa359e39ce6f0c4e2f1b8e1ec6f92cc8 /src
parent6c72f3192a2b4e6851b03e1ec34c53fc014ba24a (diff)
Replace struct update_fee_delta with lambda
Diffstat (limited to 'src')
-rw-r--r--src/txmempool.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index fb5652d0a0..81573b9cd8 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -54,16 +54,6 @@ struct update_ancestor_state
int64_t modifySigOpsCost;
};
-struct update_fee_delta
-{
- explicit update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { }
-
- void operator() (CTxMemPoolEntry &e) { e.UpdateFeeDelta(feeDelta); }
-
-private:
- int64_t feeDelta;
-};
-
bool TestLockPointValidity(CChain& active_chain, const LockPoints& lp)
{
AssertLockHeld(cs_main);
@@ -496,7 +486,7 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
CAmount delta{0};
ApplyDelta(entry.GetTx().GetHash(), delta);
if (delta) {
- mapTx.modify(newit, update_fee_delta(delta));
+ mapTx.modify(newit, [&delta](CTxMemPoolEntry& e) { e.UpdateFeeDelta(delta); });
}
// Update cachedInnerUsage to include contained transaction's usage.
@@ -931,7 +921,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD
delta += nFeeDelta;
txiter it = mapTx.find(hash);
if (it != mapTx.end()) {
- mapTx.modify(it, update_fee_delta(delta));
+ mapTx.modify(it, [&delta](CTxMemPoolEntry& e) { e.UpdateFeeDelta(delta); });
// Now update all ancestors' modified fees with descendants
setEntries setAncestors;
uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();