refactor: CTxMemPool::UpdateParent() requires CTxMemPool::cs lock

No change in behavior, the lock is already held at call sites.
This commit is contained in:
Hennadii Stepanov 2020-09-01 12:12:47 +03:00
parent bab4cce1b0
commit 939807768a
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -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);