Fix past windows, reduce exp() window from 12 to 6, for zawy20
This commit is contained in:
10
src/pow.cpp
10
src/pow.cpp
@@ -364,7 +364,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
|||||||
blocktime = pindexFirst->nTime;
|
blocktime = pindexFirst->nTime;
|
||||||
diff = (pblock->nTime - blocktime);
|
diff = (pblock->nTime - blocktime);
|
||||||
//fprintf(stderr,"%d ",diff);
|
//fprintf(stderr,"%d ",diff);
|
||||||
if ( i < 12 )
|
if ( i < 6 )
|
||||||
{
|
{
|
||||||
diff -= (8+i)*ASSETCHAINS_BLOCKTIME;
|
diff -= (8+i)*ASSETCHAINS_BLOCKTIME;
|
||||||
if ( diff > mult )
|
if ( diff > mult )
|
||||||
@@ -403,14 +403,12 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
|||||||
zawyflag = 2;
|
zawyflag = 2;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
past += 10;
|
bnTarget = RT_CST_RST_outer(height,pblock->nTime,bnTarget,ts,ct,7,3,6,past+10);
|
||||||
bnTarget = RT_CST_RST_outer(height,pblock->nTime,bnTarget,ts,ct,7,3,6,past);
|
|
||||||
if ( bnTarget < origtarget )
|
if ( bnTarget < origtarget )
|
||||||
zawyflag = 2;
|
zawyflag = 2;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
past += 10;
|
bnTarget = RT_CST_RST_outer(height,pblock->nTime,bnTarget,ts,ct,12,7,12,past+20);
|
||||||
bnTarget = RT_CST_RST_outer(height,pblock->nTime,bnTarget,ts,ct,12,7,12,past);
|
|
||||||
if ( bnTarget < origtarget )
|
if ( bnTarget < origtarget )
|
||||||
zawyflag = 2;
|
zawyflag = 2;
|
||||||
}
|
}
|
||||||
@@ -421,7 +419,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
|||||||
for (i=0; i<40; i++)
|
for (i=0; i<40; i++)
|
||||||
if ( zflags[i] == 2 )
|
if ( zflags[i] == 2 )
|
||||||
break;
|
break;
|
||||||
if ( i < past )
|
if ( i < 40 )
|
||||||
{
|
{
|
||||||
bnTarget = RT_CST_RST_inner(height,pblock->nTime,bnTarget,ts,ct,3,i);
|
bnTarget = RT_CST_RST_inner(height,pblock->nTime,bnTarget,ts,ct,3,i);
|
||||||
bnTarget6 = RT_CST_RST_inner(height,pblock->nTime,bnTarget,ts,ct,6,i);
|
bnTarget6 = RT_CST_RST_inner(height,pblock->nTime,bnTarget,ts,ct,6,i);
|
||||||
|
|||||||
Reference in New Issue
Block a user