MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / LwmaGetNextWorkRequired

Function LwmaGetNextWorkRequired

src/pow.cpp:61–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61unsigned int LwmaGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
62{
63 // Special difficulty rule for testnet:
64 // If the new block's timestamp is more than 2 * 10 minutes
65 // then allow mining of a min-difficulty block.
66 if (params.fPowAllowMinDifficultyBlocks &&
67 pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing * 2) {
68 return UintToArith256(params.PowLimit(true)).GetCompact();
69 }
70 return LwmaCalculateNextWorkRequired(pindexLast, params);
71}
72
73unsigned int LwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const Consensus::Params& params)
74{

Callers 1

GetNextWorkRequiredFunction · 0.85

Calls 4

UintToArith256Function · 0.85
GetCompactMethod · 0.80
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected