New miner, some prints. YUse equihash difficulty algo for VerusHash and PoS64
This commit is contained in:
17
src/pow.cpp
17
src/pow.cpp
@@ -44,10 +44,15 @@ unsigned int lwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const
|
||||
|
||||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
|
||||
{
|
||||
if (ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH)
|
||||
if (ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH && ASSETCHAINS_STAKED == 0)
|
||||
return lwmaGetNextWorkRequired(pindexLast, pblock, params);
|
||||
|
||||
unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();
|
||||
arith_uint256 bnLimit;
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH)
|
||||
bnLimit = UintToArith256(params.powLimit);
|
||||
else
|
||||
bnLimit = UintToArith256(params.powAlternate);
|
||||
unsigned int nProofOfWorkLimit = bnLimit.GetCompact();
|
||||
// Genesis block
|
||||
if (pindexLast == NULL )
|
||||
return nProofOfWorkLimit;
|
||||
@@ -102,7 +107,13 @@ unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,
|
||||
nActualTimespan = params.MaxActualTimespan();
|
||||
|
||||
// Retarget
|
||||
const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);
|
||||
arith_uint256 bnLimit;
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH)
|
||||
bnLimit = UintToArith256(params.powLimit);
|
||||
else
|
||||
bnLimit = UintToArith256(params.powAlternate);
|
||||
|
||||
const arith_uint256 bnPowLimit = bnLimit; //UintToArith256(params.powLimit);
|
||||
arith_uint256 bnNew {bnAvg};
|
||||
bnNew /= params.AveragingWindowTimespan();
|
||||
bnNew *= nActualTimespan;
|
||||
|
||||
Reference in New Issue
Block a user