diff options
| author | practicalswift <[email protected]> | 2017-11-14 23:35:42 +0100 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-05-05 16:50:58 +0200 |
| commit | 6bc5b7100b1182c4c060c045df9a58dada3d3eab (patch) | |
| tree | 6b2514ac576d238d3d966f170167286528e1b5cc /src/txmempool.cpp | |
| parent | Merge #13080: mempool: Add compile time checking for ::mempool.cs runtime loc... (diff) | |
| download | discoin-6bc5b7100b1182c4c060c045df9a58dada3d3eab.tar.xz discoin-6bc5b7100b1182c4c060c045df9a58dada3d3eab.zip | |
Fix missing locking in CTxMemPool::check(const CCoinsViewCache *pcoins)
* reading variable 'mapTx' requires holding mutex 'cs'
* reading variable 'mapNextTx' requires holding mutex 'cs'
* reading variable 'nCheckFrequency' requires holding mutex 'cs'
Diffstat (limited to 'src/txmempool.cpp')
| -rw-r--r-- | src/txmempool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index d03429ca8..bb585fc07 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -618,6 +618,7 @@ static void CheckInputsAndUpdateCoins(const CTransaction& tx, CCoinsViewCache& m void CTxMemPool::check(const CCoinsViewCache *pcoins) const { + LOCK(cs); if (nCheckFrequency == 0) return; @@ -632,7 +633,6 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins)); const int64_t spendheight = GetSpendHeight(mempoolDuplicate); - LOCK(cs); std::list<const CTxMemPoolEntry*> waitingOnDependants; for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) { unsigned int i = 0; |