Skip to content

Commit 9398077

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

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
@@ -978,6 +978,7 @@ void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add)
978978

979979
void CTxMemPool::UpdateParent(txiter entry, txiter parent, bool add)
980980
{
981+
AssertLockHeld(cs);
981982
setEntries s;
982983
if (add && mapLinks[entry].parents.insert(parent).second) {
983984
cachedInnerUsage += memusage::IncrementalDynamicUsage(s);

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class CTxMemPool
568568
typedef std::map<txiter, TxLinks, CompareIteratorByHash> txlinksMap;
569569
txlinksMap mapLinks;
570570

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

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

0 commit comments

Comments
 (0)