diff options
| author | practicalswift <[email protected]> | 2018-03-13 00:05:53 +0100 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-05-05 16:51:22 +0200 |
| commit | 47782b49e67599585cd766c8322ca01764fe5aa7 (patch) | |
| tree | 668dbca22e659aaf306262c76cc0af6a4bbf0b53 /src/miner.h | |
| parent | Fix missing locking in CTxMemPool::setSanityCheck(double dFrequency) (diff) | |
| download | discoin-47782b49e67599585cd766c8322ca01764fe5aa7.tar.xz discoin-47782b49e67599585cd766c8322ca01764fe5aa7.zip | |
Add Clang thread safety analysis annotations
Diffstat (limited to 'src/miner.h')
| -rw-r--r-- | src/miner.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/miner.h b/src/miner.h index 33a22ba75..ed1b4434f 100644 --- a/src/miner.h +++ b/src/miner.h @@ -8,6 +8,7 @@ #include <primitives/block.h> #include <txmempool.h> +#include <validation.h> #include <stdint.h> #include <memory> @@ -169,7 +170,7 @@ private: /** Add transactions based on feerate including unconfirmed ancestors * Increments nPackagesSelected / nDescendantsUpdated with corresponding * statistics from the package selection (for logging statistics). */ - void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated); + void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs); // helper functions for addPackageTxs() /** Remove confirmed (inBlock) entries from given set */ @@ -183,13 +184,13 @@ private: bool TestPackageTransactions(const CTxMemPool::setEntries& package); /** Return true if given transaction from mapTx has already been evaluated, * or if the transaction's cached data in mapTx is incorrect. */ - bool SkipMapTxEntry(CTxMemPool::txiter it, indexed_modified_transaction_set &mapModifiedTx, CTxMemPool::setEntries &failedTx); + bool SkipMapTxEntry(CTxMemPool::txiter it, indexed_modified_transaction_set &mapModifiedTx, CTxMemPool::setEntries &failedTx) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs); /** Sort the package in an order that is valid to appear in a block */ void SortForBlock(const CTxMemPool::setEntries& package, std::vector<CTxMemPool::txiter>& sortedEntries); /** Add descendants of given transactions to mapModifiedTx with ancestor * state updated assuming given transactions are inBlock. Returns number * of updated descendants. */ - int UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set &mapModifiedTx); + int UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set &mapModifiedTx) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs); }; /** Modify the extranonce in a block */ |