fix setgenerate false
This commit is contained in:
@@ -2211,8 +2211,8 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
|
|||||||
block_from_future_rejecttime = (uint32_t)GetAdjustedTime() + 57;
|
block_from_future_rejecttime = (uint32_t)GetAdjustedTime() + 57;
|
||||||
for (i=winners=0; i<numkp; i++)
|
for (i=winners=0; i<numkp; i++)
|
||||||
{
|
{
|
||||||
if (fRequestShutdown)
|
if ( fRequestShutdown || !GetBoolArg("-gen",false) )
|
||||||
break;
|
return(0);
|
||||||
if ( (tipindex= chainActive.Tip()) == 0 || tipindex->GetHeight()+1 > nHeight )
|
if ( (tipindex= chainActive.Tip()) == 0 || tipindex->GetHeight()+1 > nHeight )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"chain tip changed during staking loop t.%u counter.%d\n",(uint32_t)time(NULL),counter);
|
fprintf(stderr,"chain tip changed during staking loop t.%u counter.%d\n",(uint32_t)time(NULL),counter);
|
||||||
|
|||||||
@@ -535,6 +535,8 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
|
|||||||
fprintf(stderr, "Block Arrived, reset staking loop.\n");
|
fprintf(stderr, "Block Arrived, reset staking loop.\n");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
if( !GetBoolArg("-gen",false )
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1563,6 +1565,13 @@ void static BitcoinMiner()
|
|||||||
#endif
|
#endif
|
||||||
if ( ptr == 0 )
|
if ( ptr == 0 )
|
||||||
{
|
{
|
||||||
|
if ( !GetBoolArg("-gen",false))
|
||||||
|
{
|
||||||
|
miningTimer.stop();
|
||||||
|
c.disconnect();
|
||||||
|
LogPrintf("KomodoMiner terminated\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
static uint32_t counter;
|
static uint32_t counter;
|
||||||
if ( counter++ < 10 && ASSETCHAINS_STAKED == 0 )
|
if ( counter++ < 10 && ASSETCHAINS_STAKED == 0 )
|
||||||
fprintf(stderr,"created illegal blockB, retry\n");
|
fprintf(stderr,"created illegal blockB, retry\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user