Fix logic bug that started mining by default and clean up lots of stuff
This commit is contained in:
@@ -1604,28 +1604,18 @@ void static BitcoinMiner()
|
|||||||
minerThreads = NULL;
|
minerThreads = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//fprintf(stderr,"nThreads.%d fGenerate.%d\n",(int32_t)nThreads,fGenerate);
|
fprintf(stderr,"%s: nThreads.%d fGenerate.%d\n",__FUNCTION__, (int32_t)nThreads,fGenerate);
|
||||||
if ( ASSETCHAINS_STAKED > 0 && nThreads == 0 && fGenerate )
|
|
||||||
{
|
|
||||||
if ( pwallet != NULL )
|
|
||||||
nThreads = 1;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((nThreads == 0 || !fGenerate) && (pwallet == NULL))
|
if (nThreads == 0)
|
||||||
|
return;
|
||||||
|
if (!fGenerate)
|
||||||
|
return;
|
||||||
|
if (pwallet == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
minerThreads = new boost::thread_group();
|
minerThreads = new boost::thread_group();
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
|
||||||
if (ASSETCHAINS_LWMAPOS != 0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (int i = 0; i < nThreads; i++) {
|
for (int i = 0; i < nThreads; i++) {
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if ( ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH )
|
if ( ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH )
|
||||||
minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet));
|
minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet));
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) 2010 Satoshi Nakamoto
|
// Copyright (c) 2010 Satoshi Nakamoto
|
||||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||||
|
// Copyright (c) 2019 The Hush developers
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@@ -369,25 +370,11 @@ UniValue setgenerate(const UniValue& params, bool fHelp)
|
|||||||
//if (nGenProcLimit == 0)
|
//if (nGenProcLimit == 0)
|
||||||
// fGenerate = false;
|
// fGenerate = false;
|
||||||
}
|
}
|
||||||
if ( ASSETCHAINS_LWMAPOS != 0 )
|
|
||||||
{
|
|
||||||
if (fGenerate && !nGenProcLimit)
|
|
||||||
{
|
|
||||||
fGenerate = GetBoolArg("-gen", false);
|
|
||||||
KOMODO_MININGTHREADS = nGenProcLimit;
|
|
||||||
}
|
|
||||||
else if (!fGenerate)
|
|
||||||
{
|
|
||||||
KOMODO_MININGTHREADS = 0;
|
|
||||||
}
|
|
||||||
else KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
|
||||||
}
|
|
||||||
|
|
||||||
mapArgs["-gen"] = (fGenerate ? "1" : "0");
|
KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
||||||
|
fprintf(stderr,"%s:KOMODO_MININGTHREADS=%d\n", __FUNCTION__, KOMODO_MININGTHREADS);
|
||||||
|
|
||||||
|
mapArgs["-gen"] = (fGenerate ? "1" : "0");
|
||||||
mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS);
|
mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS);
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
|
|||||||
Reference in New Issue
Block a user