Merge pull request #738 from jl777/jl777

Jl777
This commit is contained in:
jl777
2018-07-08 03:03:56 -11:00
committed by GitHub
3 changed files with 16 additions and 8 deletions

View File

@@ -1147,7 +1147,7 @@ uint32_t komodo_newstake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHe
//fprintf(stderr,"komodo_stake null %.8f %u %u %u\n",dstr(value),txtime,blocktime,prevtime);
return(0);
}
if ( nHeight < 6000 ) // POSTEST64 change newstake to stake and stake to oldstake and remove
if ( nHeight < 4400 ) // POSTEST64 change newstake to stake and stake to oldstake and remove
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
mfactor = 1024;
if ( (minage= nHeight*3) > 6000 ) // about 100 blocks
@@ -1449,9 +1449,16 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
return(-1);
}
hash = pblock->GetHash();
if ( ASSETCHAINS_STAKED == 100 && height >= 4250 && height < 6000 )
/*if ( ASSETCHAINS_STAKED == 100 && height >= 4250 && height < 4400 ) // POSTEST64
{
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
else bnTarget.SetCompact(pblock->nBits,&fNegative,&fOverflow);
fprintf(stderr,"setmindiff ht.%d\n",height);
}
else*/
{
bnTarget.SetCompact(pblock->nBits,&fNegative,&fOverflow);
fprintf(stderr,"set diff ht.%d slowflag.%d\n",height,slowflag);
}
bhash = UintToArith256(hash);
possible = komodo_block2pubkey33(pubkey33,pblock);
//fprintf(stderr,"height.%d slowflag.%d possible.%d cmp.%d\n",height,slowflag,possible,bhash > bnTarget);
@@ -1481,7 +1488,8 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
}
else if ( possible == 0 || ASSETCHAINS_SYMBOL[0] != 0 )
{
if (KOMODO_TEST_ASSETCHAIN_SKIP_POW) return(0);
if ( KOMODO_TEST_ASSETCHAIN_SKIP_POW )
return(0);
fprintf(stderr,"pow violation and no chance it is notary ht.%d %s\n",height,hash.ToString().c_str());
return(-1);
}
@@ -1490,7 +1498,7 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
{
if ( (is_PoSblock= komodo_is_PoSblock(slowflag,height,pblock,bnTarget)) == 0 )
{
if ( ASSETCHAINS_STAKED == 100 && height > 130 ) // only PoS allowed!
if ( ASSETCHAINS_STAKED == 100 && height > 130 ) // only PoS allowed! POSTEST64
return(-1);
else
{

View File

@@ -911,7 +911,7 @@ void static BitcoinMiner()
} //else fprintf(stderr,"duplicate at j.%d\n",j);
} else Mining_start = 0;
} else Mining_start = 0;
if ( ASSETCHAINS_STAKED != 0 && GetArg("-genproclimit", 0) == 0 )
if ( ASSETCHAINS_STAKED != 0 && GetArg("-genproclimit", 0) == 0 )
{
int32_t percPoS,z;
/*if ( Mining_height <= 100 )
@@ -920,7 +920,7 @@ void static BitcoinMiner()
continue;
}*/
HASHTarget_POW = komodo_PoWtarget(&percPoS,HASHTarget,Mining_height,ASSETCHAINS_STAKED);
if ( Mining_height >= 4000 && Mining_height < 6000 ) // POSTEST64 remove this
if ( Mining_height >= 4000 && Mining_height < 4400 ) // POSTEST64 remove this
HASHTarget = arith_uint256().SetCompact(KOMODO_MINDIFF_NBITS);
if ( ASSETCHAINS_STAKED < 100 )
{

View File

@@ -190,7 +190,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int
}
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
return error("CheckProofOfWork(): nBits below minimum work");
if ( ASSETCHAINS_STAKED != 0 && height >= 4200 && height < 6000 ) // POSTEST64 remove this
if ( ASSETCHAINS_STAKED != 0 && height >= 4200 && height < 4400 ) // POSTEST64 remove this
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
// Check proof of work matches claimed amount
if ( UintToArith256(hash) > bnTarget )