Allow disabling adaptivepow
This commit is contained in:
@@ -2283,7 +2283,7 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
|
||||
if ( height == 0 )
|
||||
return(0);
|
||||
}
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW != 0 )
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW > 0 )
|
||||
bnTarget = komodo_adaptivepow_target(height,bnTarget,pblock->nTime);
|
||||
if ( ASSETCHAINS_LWMAPOS != 0 && bhash > bnTarget )
|
||||
{
|
||||
|
||||
@@ -50,7 +50,8 @@ uint256 KOMODO_EARLYTXID;
|
||||
int32_t KOMODO_MININGTHREADS = -1,IS_KOMODO_NOTARY,IS_STAKED_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND,STAKED_ERA,KOMODO_CONNECTING = -1,KOMODO_DEALERNODE,KOMODO_EXTRASATOSHI,ASSETCHAINS_FOUNDERS,ASSETCHAINS_CBMATURITY,KOMODO_NSPV;
|
||||
int32_t KOMODO_INSYNC,KOMODO_LASTMINED,prevKOMODO_LASTMINED,KOMODO_CCACTIVATE,JUMBLR_PAUSE = 1;
|
||||
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY,DONATION_PUBKEY,ASSETCHAINS_SCRIPTPUB,NOTARY_ADDRESS,ASSETCHAINS_SELFIMPORT,ASSETCHAINS_CCLIB;
|
||||
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA,ASSETCHAINS_ADAPTIVEPOW;
|
||||
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA;
|
||||
int8_t ASSETCHAINS_ADAPTIVEPOW;
|
||||
bool VERUS_MINTBLOCKS;
|
||||
std::vector<uint8_t> Mineropret;
|
||||
std::vector<std::string> vWhiteListAddress;
|
||||
|
||||
@@ -2431,7 +2431,7 @@ fprintf(stderr,"extralen.%d before disable bits\n",extralen);
|
||||
CCENABLE(EVAL_DICE);
|
||||
CCENABLE(EVAL_ORACLES);
|
||||
}
|
||||
if ( (pindex= komodo_activechain(1)) != 0 )
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW == 0 && (pindex= komodo_activechain(1)) != 0 )
|
||||
{
|
||||
if ( pindex->nTime > 1564499104-365*2*1440 )
|
||||
{
|
||||
|
||||
@@ -1447,7 +1447,7 @@ void static BitcoinMiner_noeq()
|
||||
HASHTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
||||
LogPrintf("Block %d : PoS %d%% vs target %d%%\n", Mining_height, percPoS, (int32_t)ASSETCHAINS_STAKED);
|
||||
}
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW != 0 && ASSETCHAINS_STAKED == 0 )
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW > 0 && ASSETCHAINS_STAKED == 0 )
|
||||
HASHTarget_POW = komodo_adaptivepow_target(Mining_height,HASHTarget,pblock->nTime);
|
||||
|
||||
while (true)
|
||||
@@ -1482,7 +1482,7 @@ void static BitcoinMiner_noeq()
|
||||
}
|
||||
else if ( ASSETCHAINS_STAKED == 100 && Mining_height > 100 )
|
||||
hashTarget = HASHTarget;
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW != 0 && ASSETCHAINS_STAKED == 0 )
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW > 0 && ASSETCHAINS_STAKED == 0 )
|
||||
hashTarget = HASHTarget_POW;
|
||||
|
||||
// for speed check NONCEMASK at a time
|
||||
@@ -1820,7 +1820,7 @@ void static BitcoinMiner()
|
||||
if ( ASSETCHAINS_STAKED < 100 )
|
||||
LogPrintf("Block %d : PoS %d%% vs target %d%% \n",Mining_height,percPoS,(int32_t)ASSETCHAINS_STAKED);
|
||||
}
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW != 0 )
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW > 0 )
|
||||
HASHTarget_POW = komodo_adaptivepow_target(Mining_height,HASHTarget,pblock->nTime);
|
||||
gotinvalid = 0;
|
||||
while (true)
|
||||
@@ -1849,7 +1849,7 @@ void static BitcoinMiner()
|
||||
arith_uint256 hashTarget;
|
||||
if ( KOMODO_MININGTHREADS > 0 && ASSETCHAINS_STAKED > 0 && ASSETCHAINS_STAKED < 100 && Mining_height > 10 )
|
||||
hashTarget = HASHTarget_POW;
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW != 0 )
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW > 0 )
|
||||
hashTarget = HASHTarget_POW;
|
||||
else hashTarget = HASHTarget;
|
||||
std::function<bool(std::vector<unsigned char>)> validBlock =
|
||||
@@ -2040,7 +2040,7 @@ void static BitcoinMiner()
|
||||
// Update nNonce and nTime
|
||||
pblock->nNonce = ArithToUint256(UintToArith256(pblock->nNonce) + 1);
|
||||
pblock->nBits = savebits;
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW != 0 )
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW > 0 )
|
||||
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
|
||||
/*if ( NOTARY_PUBKEY33[0] == 0 )
|
||||
{
|
||||
|
||||
@@ -453,7 +453,7 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t
|
||||
arith_uint256 bnMaxPoSdiff;
|
||||
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
||||
}
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW != 0 && ASSETCHAINS_STAKED == 0 )
|
||||
else if ( ASSETCHAINS_ADAPTIVEPOW > 0 && ASSETCHAINS_STAKED == 0 )
|
||||
bnTarget = komodo_adaptivepow_target(height,bnTarget,blkHeader.nTime);
|
||||
// Check proof of work matches claimed amount
|
||||
if ( UintToArith256(hash = blkHeader.GetHash()) > bnTarget && !blkHeader.IsVerusPOSBlock() )
|
||||
|
||||
Reference in New Issue
Block a user