@@ -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);
|
//fprintf(stderr,"komodo_stake null %.8f %u %u %u\n",dstr(value),txtime,blocktime,prevtime);
|
||||||
return(0);
|
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);
|
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
||||||
mfactor = 1024;
|
mfactor = 1024;
|
||||||
if ( (minage= nHeight*3) > 6000 ) // about 100 blocks
|
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);
|
return(-1);
|
||||||
}
|
}
|
||||||
hash = pblock->GetHash();
|
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);
|
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);
|
bhash = UintToArith256(hash);
|
||||||
possible = komodo_block2pubkey33(pubkey33,pblock);
|
possible = komodo_block2pubkey33(pubkey33,pblock);
|
||||||
//fprintf(stderr,"height.%d slowflag.%d possible.%d cmp.%d\n",height,slowflag,possible,bhash > bnTarget);
|
//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 )
|
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());
|
fprintf(stderr,"pow violation and no chance it is notary ht.%d %s\n",height,hash.ToString().c_str());
|
||||||
return(-1);
|
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 ( (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);
|
return(-1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -911,7 +911,7 @@ void static BitcoinMiner()
|
|||||||
} //else fprintf(stderr,"duplicate at j.%d\n",j);
|
} //else fprintf(stderr,"duplicate at j.%d\n",j);
|
||||||
} else Mining_start = 0;
|
} else Mining_start = 0;
|
||||||
} 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;
|
int32_t percPoS,z;
|
||||||
/*if ( Mining_height <= 100 )
|
/*if ( Mining_height <= 100 )
|
||||||
@@ -920,7 +920,7 @@ void static BitcoinMiner()
|
|||||||
continue;
|
continue;
|
||||||
}*/
|
}*/
|
||||||
HASHTarget_POW = komodo_PoWtarget(&percPoS,HASHTarget,Mining_height,ASSETCHAINS_STAKED);
|
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);
|
HASHTarget = arith_uint256().SetCompact(KOMODO_MINDIFF_NBITS);
|
||||||
if ( ASSETCHAINS_STAKED < 100 )
|
if ( ASSETCHAINS_STAKED < 100 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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))
|
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
|
||||||
return error("CheckProofOfWork(): nBits below minimum work");
|
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);
|
bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
|
||||||
// Check proof of work matches claimed amount
|
// Check proof of work matches claimed amount
|
||||||
if ( UintToArith256(hash) > bnTarget )
|
if ( UintToArith256(hash) > bnTarget )
|
||||||
|
|||||||
Reference in New Issue
Block a user