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

Function ReduceDifficultyBy

src/pow.cpp:209–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209unsigned int ReduceDifficultyBy(const CBlockIndex* pindexLast, int64_t multiplier, const Consensus::Params& params) {
210 arith_uint256 target;
211 target.SetCompact(pindexLast->nBits);
212 target *= multiplier;
213 const arith_uint256 pow_limit = UintToArith256(params.PowLimit(true));
214 if (target > pow_limit) {
215 target = pow_limit;
216 }
217 return target.GetCompact();
218}
219
220unsigned int BitcoinCalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params& params)
221{

Callers 2

GetNextWorkRequiredFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

UintToArith256Function · 0.85
GetCompactMethod · 0.80

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68