Skip to content

Commit e177fca

Browse files
glozowhebasto
andcommitted
Replace struct update_lock_points with lambda
No behavior change. This code was introduced in 5add7a7 before we required C++11, which is why the struct was needed. As we are now using more modern C++ and this is the only place where lockpoints are updated for mempool entries, it is more idiomatic to call `modify` with a lambda. Co-authored-by: Hennadii Stepanov <[email protected]>
1 parent c7cd98c commit e177fca

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

src/txmempool.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,6 @@ class CompareTxMemPoolEntryByAncestorFee
312312
}
313313
};
314314

315-
struct update_lock_points
316-
{
317-
explicit update_lock_points(const LockPoints& _lp) : lp(_lp) { }
318-
319-
void operator() (CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); }
320-
321-
private:
322-
const LockPoints& lp;
323-
};
324-
325315
// Multi_index tag names
326316
struct descendant_score {};
327317
struct entry_time {};

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void CChainState::MaybeUpdateMempoolForReorg(
375375
} else if (!validLP) {
376376
// If CheckSequenceLocks succeeded, it also updated the LockPoints.
377377
// Now update the mempool entry lockpoints as well.
378-
m_mempool->mapTx.modify(it, update_lock_points(lp));
378+
m_mempool->mapTx.modify(it, [&lp](CTxMemPoolEntry& e) { e.UpdateLockPoints(lp); });
379379
}
380380

381381
// If the transaction spends any coinbase outputs, it must be mature.

0 commit comments

Comments
 (0)