aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2019-05-23 19:17:09 +0200
committerMarcoFalke <[email protected]>2019-06-07 11:06:00 +0200
commitfa0c9dbf9156d64a4b9bff858da97825369a9134 (patch)
treee54ed5513a012acbe92cb553814f30ace3e54f16 /src/txmempool.h
parentMerge #16129: refactor: Remove unused includes (diff)
downloaddiscoin-fa0c9dbf9156d64a4b9bff858da97825369a9134.tar.xz
discoin-fa0c9dbf9156d64a4b9bff858da97825369a9134.zip
txpool: Make nTransactionsUpdated atomic
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index ce0b76233..59514a945 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -6,12 +6,13 @@
#ifndef BITCOIN_TXMEMPOOL_H
#define BITCOIN_TXMEMPOOL_H
+#include <atomic>
+#include <map>
#include <memory>
#include <set>
-#include <map>
-#include <vector>
-#include <utility>
#include <string>
+#include <utility>
+#include <vector>
#include <amount.h>
#include <coins.h>
@@ -443,7 +444,7 @@ class CTxMemPool
{
private:
uint32_t nCheckFrequency GUARDED_BY(cs); //!< Value n means that n times in 2^32 we check.
- unsigned int nTransactionsUpdated; //!< Used by getblocktemplate to trigger CreateNewBlock() invocation
+ std::atomic<unsigned int> nTransactionsUpdated; //!< Used by getblocktemplate to trigger CreateNewBlock() invocation
CBlockPolicyEstimator* minerPolicyEstimator;
uint64_t totalTxSize; //!< sum of all mempool tx's virtual sizes. Differs from serialized tx size since witness data is discounted. Defined in BIP 141.