Fix bug where GetNextWorkRequired did not know about randomx
This commit is contained in:
@@ -297,8 +297,11 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
||||
if (pindexLast->GetHeight() == 340000) {
|
||||
LogPrintf("%s: Using blocktime=%d\n",__func__,ASSETCHAINS_BLOCKTIME);
|
||||
}
|
||||
if (ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH && ASSETCHAINS_STAKED == 0)
|
||||
//if (ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH && ASSETCHAINS_STAKED == 0)
|
||||
if (ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH && ASSETCHAINS_ALGO != ASSETCHAINS_RANDOMX) {
|
||||
fprintf(stderr,"%s: using lwma for next work\n",__func__);
|
||||
return lwmaGetNextWorkRequired(pindexLast, pblock, params);
|
||||
}
|
||||
|
||||
arith_uint256 bnLimit;
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH)
|
||||
@@ -500,7 +503,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
||||
nbits = bnTarget.GetCompact();
|
||||
nbits = (nbits & 0xfffffffc) | zawyflag;
|
||||
}
|
||||
if(fDebug)
|
||||
//if(fDebug)
|
||||
fprintf(stderr,"%s: nbits=%d\n", __func__, nbits);
|
||||
return(nbits);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user