Fix issue#1082, testnet difficulty unsigned integer underflow
This commit is contained in:
parent
feeb761ba0
commit
248bceb30c
@ -865,12 +865,12 @@ unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBl
|
|||||||
// Only change once per interval
|
// Only change once per interval
|
||||||
if ((pindexLast->nHeight+1) % nInterval != 0)
|
if ((pindexLast->nHeight+1) % nInterval != 0)
|
||||||
{
|
{
|
||||||
// Special rules for testnet after 15 Feb 2012:
|
// Special difficulty rule for testnet:
|
||||||
if (fTestNet && pblock->nTime > 1329264000)
|
if (fTestNet)
|
||||||
{
|
{
|
||||||
// If the new block's timestamp is more than 2* 10 minutes
|
// If the new block's timestamp is more than 2* 10 minutes
|
||||||
// then allow mining of a min-difficulty block.
|
// then allow mining of a min-difficulty block.
|
||||||
if (pblock->nTime - pindexLast->nTime > nTargetSpacing*2)
|
if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2)
|
||||||
return nProofOfWorkLimit;
|
return nProofOfWorkLimit;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user