Fix bug where GetNextWorkRequired did not know about randomx

This commit is contained in:
Duke Leto
2022-07-01 13:43:51 -04:00
parent a45150eac4
commit 05cbc86a00
3 changed files with 16 additions and 3 deletions

View File

@@ -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);
}