Skip to content

Commit fa8857c

Browse files
author
MarcoFalke
committed
Replace struct update_fee_delta with lambda
1 parent 6c72f31 commit fa8857c

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/txmempool.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ struct update_ancestor_state
5454
int64_t modifySigOpsCost;
5555
};
5656

57-
struct update_fee_delta
58-
{
59-
explicit update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { }
60-
61-
void operator() (CTxMemPoolEntry &e) { e.UpdateFeeDelta(feeDelta); }
62-
63-
private:
64-
int64_t feeDelta;
65-
};
66-
6757
bool TestLockPointValidity(CChain& active_chain, const LockPoints& lp)
6858
{
6959
AssertLockHeld(cs_main);
@@ -496,7 +486,7 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
496486
CAmount delta{0};
497487
ApplyDelta(entry.GetTx().GetHash(), delta);
498488
if (delta) {
499-
mapTx.modify(newit, update_fee_delta(delta));
489+
mapTx.modify(newit, [&delta](CTxMemPoolEntry& e) { e.UpdateFeeDelta(delta); });
500490
}
501491

502492
// Update cachedInnerUsage to include contained transaction's usage.
@@ -931,7 +921,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD
931921
delta += nFeeDelta;
932922
txiter it = mapTx.find(hash);
933923
if (it != mapTx.end()) {
934-
mapTx.modify(it, update_fee_delta(delta));
924+
mapTx.modify(it, [&delta](CTxMemPoolEntry& e) { e.UpdateFeeDelta(delta); });
935925
// Now update all ancestors' modified fees with descendants
936926
setEntries setAncestors;
937927
uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();

0 commit comments

Comments
 (0)