mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Merge pull request #2349 from dserrano5/master
Accept negative -par values to leave N CPUs free.
This commit is contained in:
commit
228b29cf8f
@ -349,7 +349,7 @@ std::string HelpMessage()
|
|||||||
" -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" +
|
" -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" +
|
||||||
" -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" +
|
" -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" +
|
||||||
" -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" +
|
" -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" +
|
||||||
" -par=<n> " + _("Set the number of script verification threads (1-16, 0=auto, default: 0)") + "\n" +
|
" -par=N " + _("Set the number of script verification threads (up to 16, 0=auto, negative=leave N CPUs free, default: 0)") + "\n" +
|
||||||
|
|
||||||
"\n" + _("Block creation options:") + "\n" +
|
"\n" + _("Block creation options:") + "\n" +
|
||||||
" -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n" +
|
" -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n" +
|
||||||
@ -525,8 +525,8 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
|
|
||||||
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
|
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
|
||||||
nScriptCheckThreads = GetArg("-par", 0);
|
nScriptCheckThreads = GetArg("-par", 0);
|
||||||
if (nScriptCheckThreads == 0)
|
if (nScriptCheckThreads <= 0)
|
||||||
nScriptCheckThreads = boost::thread::hardware_concurrency();
|
nScriptCheckThreads += boost::thread::hardware_concurrency();
|
||||||
if (nScriptCheckThreads <= 1)
|
if (nScriptCheckThreads <= 1)
|
||||||
nScriptCheckThreads = 0;
|
nScriptCheckThreads = 0;
|
||||||
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
|
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
|
||||||
|
Loading…
Reference in New Issue
Block a user