mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-10 14:14:30 +00:00
Difficulty 1 is: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
This commit is contained in:
parent
7fbe6d4a6c
commit
2d8820811e
@ -63,15 +63,17 @@ double GetDifficulty(const CChain& chain, const CBlockIndex* blockindex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nShift = (blockindex->nBits >> 24) & 0xff;
|
int nShift = (blockindex->nBits >> 24) & 0xff;
|
||||||
double dDiff =
|
|
||||||
(double)0x0ffff0 / (double)(blockindex->nBits & 0x00ffffff);
|
|
||||||
|
|
||||||
while (nShift < 31)
|
// Difficulty 1 is: 0x2100ffff
|
||||||
|
double dDiff =
|
||||||
|
(double)0x00ffff / (double)(blockindex->nBits & 0x00ffffff);
|
||||||
|
|
||||||
|
while (nShift < 33)
|
||||||
{
|
{
|
||||||
dDiff *= 256.0;
|
dDiff *= 256.0;
|
||||||
nShift++;
|
nShift++;
|
||||||
}
|
}
|
||||||
while (nShift > 31)
|
while (nShift > 33)
|
||||||
{
|
{
|
||||||
dDiff /= 256.0;
|
dDiff /= 256.0;
|
||||||
nShift--;
|
nShift--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user