mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
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 <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
parent
c7cd98c717
commit
e177fcab38
2 changed files with 1 additions and 11 deletions
|
@ -312,16 +312,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct update_lock_points
|
||||
{
|
||||
explicit update_lock_points(const LockPoints& _lp) : lp(_lp) { }
|
||||
|
||||
void operator() (CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); }
|
||||
|
||||
private:
|
||||
const LockPoints& lp;
|
||||
};
|
||||
|
||||
// Multi_index tag names
|
||||
struct descendant_score {};
|
||||
struct entry_time {};
|
||||
|
|
|
@ -375,7 +375,7 @@ void CChainState::MaybeUpdateMempoolForReorg(
|
|||
} else if (!validLP) {
|
||||
// If CheckSequenceLocks succeeded, it also updated the LockPoints.
|
||||
// Now update the mempool entry lockpoints as well.
|
||||
m_mempool->mapTx.modify(it, update_lock_points(lp));
|
||||
m_mempool->mapTx.modify(it, [&lp](CTxMemPoolEntry& e) { e.UpdateLockPoints(lp); });
|
||||
}
|
||||
|
||||
// If the transaction spends any coinbase outputs, it must be mature.
|
||||
|
|
Loading…
Reference in a new issue