diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-05-23 19:17:09 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-06-07 11:06:00 +0200 |
commit | fa0c9dbf9156d64a4b9bff858da97825369a9134 (patch) | |
tree | e54ed5513a012acbe92cb553814f30ace3e54f16 /src/txmempool.cpp | |
parent | d0f81a96d9c158a9226dc946bdd61d48c4d42959 (diff) |
txpool: Make nTransactionsUpdated atomic
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r-- | src/txmempool.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index cac7beb6a1..2f4e5fee4b 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -322,8 +322,8 @@ void CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, CAmount modifyFee, assert(int(nSigOpCostWithAncestors) >= 0); } -CTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator) : - nTransactionsUpdated(0), minerPolicyEstimator(estimator) +CTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator) + : nTransactionsUpdated(0), minerPolicyEstimator(estimator) { _clear(); //lock free clear @@ -341,13 +341,11 @@ bool CTxMemPool::isSpent(const COutPoint& outpoint) const unsigned int CTxMemPool::GetTransactionsUpdated() const { - LOCK(cs); return nTransactionsUpdated; } void CTxMemPool::AddTransactionsUpdated(unsigned int n) { - LOCK(cs); nTransactionsUpdated += n; } |