diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-11-07 10:07:01 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-11-07 10:07:11 -0500 |
commit | 7d14e35f3fb7a1a651ff51e71c58cdea84643a82 (patch) | |
tree | eaa206de30ca725873285971c81c03be788f84ab /src/validation.h | |
parent | 46e0e276398ea118451f509da1752e16a0b0678a (diff) | |
parent | 5506ecfe7a65d5705616bc048f2f1735b89993fb (diff) |
Merge #17342: refactor: Clean up nScriptCheckThreads
5506ecfe7a65d5705616bc048f2f1735b89993fb [refactor] Replace global int nScriptCheckThreads with bool (John Newbery)
d9957623b48a7c3eff0ac750d1245fabfb1843a2 [tests] Don't use TestingSetup in the checkqueue_tests (John Newbery)
Pull request description:
The meaning of this value is confusing. Refactor it and add comments.
ACKs for top commit:
sipa:
ACK 5506ecfe7a65d5705616bc048f2f1735b89993fb
promag:
ACK 5506ecfe7a65d5705616bc048f2f1735b89993fb, only change was addressing my nits.
laanwj:
Code review ACK 5506ecfe7a65d5705616bc048f2f1735b89993fb
MarcoFalke:
ACK 5506ecfe7a65d5705616bc048f2f1735b89993fb 🥐
Tree-SHA512: 78536727c98d2c23f3c0f3f169131474fef9a4486ae65029011caf06eab30f6f70ff73a65b2fb04a5d969fc1150858d1c6ea4767f04d48c1eea6b829316d0e63
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/validation.h b/src/validation.h index e9127040bf..31721cfbf7 100644 --- a/src/validation.h +++ b/src/validation.h @@ -77,8 +77,8 @@ static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB /** The pre-allocation chunk size for rev?????.dat files (since 0.8) */ static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB -/** Maximum number of script-checking threads allowed */ -static const int MAX_SCRIPTCHECK_THREADS = 16; +/** Maximum number of dedicated script-checking threads allowed */ +static const int MAX_SCRIPTCHECK_THREADS = 15; /** -par default (number of script-checking threads, 0 = auto) */ static const int DEFAULT_SCRIPTCHECK_THREADS = 0; /** Number of blocks that can be requested at any given time from a single peer. */ @@ -147,7 +147,10 @@ extern std::condition_variable g_best_block_cv; extern uint256 g_best_block; extern std::atomic_bool fImporting; extern std::atomic_bool fReindex; -extern int nScriptCheckThreads; +/** Whether there are dedicated script-checking threads running. + * False indicates all script checking is done on the main threadMessageHandler thread. + */ +extern bool g_parallel_script_checks; extern bool fRequireStandard; extern bool fCheckBlockIndex; extern bool fCheckpointsEnabled; |