remove debugging variable bnOld in retarget algorithm, clean up white spaces
This commit is contained in:
parent
d26db867dd
commit
172f6aca32
1 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "lbry.h"
|
#include "lbry.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
unsigned int CalculateLbryNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params& params)
|
unsigned int CalculateLbryNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params& params)
|
||||||
{
|
{
|
||||||
if (params.fPowNoRetargeting)
|
if (params.fPowNoRetargeting)
|
||||||
|
@ -26,9 +27,7 @@ unsigned int CalculateLbryNextWorkRequired(const CBlockIndex* pindexLast, int64_
|
||||||
// Retarget
|
// Retarget
|
||||||
const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);
|
const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);
|
||||||
arith_uint256 bnNew;
|
arith_uint256 bnNew;
|
||||||
arith_uint256 bnOld;
|
|
||||||
bnNew.SetCompact(pindexLast->nBits);
|
bnNew.SetCompact(pindexLast->nBits);
|
||||||
bnOld = bnNew;
|
|
||||||
bnNew *= nModulatedTimespan;
|
bnNew *= nModulatedTimespan;
|
||||||
bnNew /= retargetTimespan;
|
bnNew /= retargetTimespan;
|
||||||
if (bnNew > bnPowLimit)
|
if (bnNew > bnPowLimit)
|
||||||
|
|
Loading…
Reference in a new issue