Skip to content

Commit 66e47e5

Browse files
committed
refactor: CTxMemPool::UpdateChild() requires CTxMemPool::cs lock
No change in behavior, the lock is already held at call sites.
1 parent 9398077 commit 66e47e5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/txmempool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, bool validFeeEstimat
968968

969969
void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add)
970970
{
971+
AssertLockHeld(cs);
971972
setEntries s;
972973
if (add && mapLinks[entry].children.insert(child).second) {
973974
cachedInnerUsage += memusage::IncrementalDynamicUsage(s);

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ class CTxMemPool
569569
txlinksMap mapLinks;
570570

571571
void UpdateParent(txiter entry, txiter parent, bool add) EXCLUSIVE_LOCKS_REQUIRED(cs);
572-
void UpdateChild(txiter entry, txiter child, bool add);
572+
void UpdateChild(txiter entry, txiter child, bool add) EXCLUSIVE_LOCKS_REQUIRED(cs);
573573

574574
std::vector<indexed_transaction_set::const_iterator> GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs);
575575

0 commit comments

Comments
 (0)