aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/txmempool.cpp1
-rw-r--r--src/txmempool.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index de1a3ec68f..ef2ec661e8 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -978,6 +978,7 @@ void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add)
void CTxMemPool::UpdateParent(txiter entry, txiter parent, bool add)
{
+ AssertLockHeld(cs);
setEntries s;
if (add && mapLinks[entry].parents.insert(parent).second) {
cachedInnerUsage += memusage::IncrementalDynamicUsage(s);
diff --git a/src/txmempool.h b/src/txmempool.h
index 4743e1b63a..fbff1afcca 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -568,7 +568,7 @@ private:
typedef std::map<txiter, TxLinks, CompareIteratorByHash> txlinksMap;
txlinksMap mapLinks;
- void UpdateParent(txiter entry, txiter parent, bool add);
+ void UpdateParent(txiter entry, txiter parent, bool add) EXCLUSIVE_LOCKS_REQUIRED(cs);
void UpdateChild(txiter entry, txiter child, bool add);
std::vector<indexed_transaction_set::const_iterator> GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs);