@@ -1874,9 +1874,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
VERUS_MINTBLOCKS = GetBoolArg("-mint", false);
|
||||
|
||||
if (pwalletMain || !GetArg("-mineraddress", "").empty())
|
||||
GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain, GetArg("-genproclimit", 0));
|
||||
GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain, GetArg("-genproclimit", -1));
|
||||
#else
|
||||
GenerateBitcoins(GetBoolArg("-gen", false), GetArg("-genproclimit", 0));
|
||||
GenerateBitcoins(GetBoolArg("-gen", false), GetArg("-genproclimit", -1));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1665,8 +1665,9 @@ void komodo_args(char *argv0)
|
||||
MIN_RECV_SATS = GetArg("-mintxvalue",-1);
|
||||
WHITELIST_ADDRESS = GetArg("-whitelistaddress","");
|
||||
if ( GetBoolArg("-gen", false) != 0 )
|
||||
KOMODO_MININGTHREADS = GetArg("-genproclimit",1);
|
||||
else KOMODO_MININGTHREADS = 0;
|
||||
{
|
||||
KOMODO_MININGTHREADS = GetArg("-genproclimit",-1);
|
||||
}
|
||||
if ( (KOMODO_EXCHANGEWALLET= GetBoolArg("-exchange", false)) != 0 )
|
||||
fprintf(stderr,"KOMODO_EXCHANGEWALLET mode active\n");
|
||||
DONATION_PUBKEY = GetArg("-donation", "");
|
||||
@@ -1681,6 +1682,8 @@ void komodo_args(char *argv0)
|
||||
if ( strcmp(NOTARY_PUBKEY.c_str(),Notaries_elected1[i][1]) == 0 )
|
||||
{
|
||||
IS_KOMODO_NOTARY = 1;
|
||||
KOMODO_MININGTHREADS = 1;
|
||||
mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS);
|
||||
IS_STAKED_NOTARY = -1;
|
||||
fprintf(stderr,"running as notary.%d %s\n",i,Notaries_elected1[i][0]);
|
||||
break;
|
||||
@@ -1782,8 +1785,9 @@ void komodo_args(char *argv0)
|
||||
// for now, we only support 50% PoS due to other parts of the algorithm needing adjustment for
|
||||
// other values
|
||||
if ( (ASSETCHAINS_LWMAPOS = GetArg("-ac_veruspos",0)) != 0 )
|
||||
{
|
||||
ASSETCHAINS_LWMAPOS = 50;
|
||||
|
||||
}
|
||||
ASSETCHAINS_SAPLING = GetArg("-ac_sapling", -1);
|
||||
if (ASSETCHAINS_SAPLING == -1)
|
||||
{
|
||||
|
||||
@@ -1466,7 +1466,7 @@ void static BitcoinMiner()
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
// notaries always default to staking
|
||||
CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey, pindexPrev->GetHeight()+1, gpucount, ASSETCHAINS_STAKED != 0 && GetArg("-genproclimit", 0) == 0);
|
||||
CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey, pindexPrev->GetHeight()+1, gpucount, ASSETCHAINS_STAKED != 0 && GetArg("-genproclimit", -1) == 0);
|
||||
#else
|
||||
CBlockTemplate *ptr = CreateNewBlockWithKey();
|
||||
#endif
|
||||
@@ -1856,8 +1856,7 @@ void static BitcoinMiner()
|
||||
}
|
||||
|
||||
//fprintf(stderr,"nThreads.%d fGenerate.%d\n",(int32_t)nThreads,fGenerate);
|
||||
|
||||
if ( ASSETCHAINS_STAKED > 0 && nThreads == 0 )
|
||||
if ( ASSETCHAINS_STAKED > 0 && nThreads == 0 && fGenerate )
|
||||
{
|
||||
if ( pwallet != NULL )
|
||||
nThreads = 1;
|
||||
|
||||
@@ -339,22 +339,25 @@ UniValue setgenerate(const UniValue& params, bool fHelp)
|
||||
//if (nGenProcLimit == 0)
|
||||
// fGenerate = false;
|
||||
}
|
||||
|
||||
if (fGenerate && !nGenProcLimit)
|
||||
if ( ASSETCHAINS_LWMAPOS != 0 )
|
||||
{
|
||||
VERUS_MINTBLOCKS = 1;
|
||||
fGenerate = GetBoolArg("-gen", false);
|
||||
if ( ASSETCHAINS_STAKED == 0 )
|
||||
nGenProcLimit = KOMODO_MININGTHREADS;
|
||||
else
|
||||
if (fGenerate && !nGenProcLimit)
|
||||
{
|
||||
VERUS_MINTBLOCKS = 1;
|
||||
fGenerate = GetBoolArg("-gen", false);
|
||||
KOMODO_MININGTHREADS = nGenProcLimit;
|
||||
}
|
||||
else if (!fGenerate)
|
||||
{
|
||||
VERUS_MINTBLOCKS = 0;
|
||||
KOMODO_MININGTHREADS = 0;
|
||||
}
|
||||
else KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
||||
}
|
||||
else if (!fGenerate)
|
||||
else
|
||||
{
|
||||
VERUS_MINTBLOCKS = 0;
|
||||
KOMODO_MININGTHREADS = 0;
|
||||
KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
||||
}
|
||||
else KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
||||
|
||||
mapArgs["-gen"] = (fGenerate ? "1" : "0");
|
||||
mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS);
|
||||
|
||||
Reference in New Issue
Block a user