From 66e47e5e506043fbb9b4e487b44bf992985709c9 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 1 Sep 2020 12:18:20 +0300 Subject: refactor: CTxMemPool::UpdateChild() requires CTxMemPool::cs lock No change in behavior, the lock is already held at call sites. --- src/txmempool.cpp | 1 + src/txmempool.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index ef2ec661e8..ea6d7e808c 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -968,6 +968,7 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, bool validFeeEstimat void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add) { + AssertLockHeld(cs); setEntries s; if (add && mapLinks[entry].children.insert(child).second) { cachedInnerUsage += memusage::IncrementalDynamicUsage(s); diff --git a/src/txmempool.h b/src/txmempool.h index fbff1afcca..05455b8bdd 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -569,7 +569,7 @@ private: txlinksMap mapLinks; void UpdateParent(txiter entry, txiter parent, bool add) EXCLUSIVE_LOCKS_REQUIRED(cs); - void UpdateChild(txiter entry, txiter child, bool add); + void UpdateChild(txiter entry, txiter child, bool add) EXCLUSIVE_LOCKS_REQUIRED(cs); std::vector GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs); -- cgit v1.2.3