Merge pull request #730 from jl777/jl777

Remove mindiff cap for 100% PoS
This commit is contained in:
jl777
2018-07-05 21:48:39 -11:00
committed by GitHub
2 changed files with 9 additions and 6 deletions

View File

@@ -466,7 +466,7 @@ bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
const COutPoint &prevout = tx.vin[i].prevout; const COutPoint &prevout = tx.vin[i].prevout;
const CCoins* coins = AccessCoins(prevout.hash); const CCoins* coins = AccessCoins(prevout.hash);
if (!coins || !coins->IsAvailable(prevout.n)) { if (!coins || !coins->IsAvailable(prevout.n)) {
fprintf(stderr,"HaveInputs missing input %s/v%d\n",prevout.hash.ToString().c_str(),prevout.n); //fprintf(stderr,"HaveInputs missing input %s/v%d\n",prevout.hash.ToString().c_str(),prevout.n);
return false; return false;
} }
} }

View File

@@ -1094,13 +1094,16 @@ uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeigh
blocktime = prevtime+57; blocktime = prevtime+57;
if ( value == 0 || txtime == 0 || blocktime == 0 || prevtime == 0 ) if ( value == 0 || txtime == 0 || blocktime == 0 || prevtime == 0 )
{ {
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);
} }
bnMaxPoSdiff.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow); if ( ASSETCHAINS_STAKED != 100 || nHeight < 2000 )
bnMaxPoSdiff = (bnMaxPoSdiff / arith_uint256(4)); {
if ( bnTarget < bnMaxPoSdiff ) bnMaxPoSdiff.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
bnTarget = bnMaxPoSdiff; bnMaxPoSdiff = (bnMaxPoSdiff / arith_uint256(4));
if ( bnTarget < bnMaxPoSdiff )
bnTarget = bnMaxPoSdiff;
}
if ( (minage= nHeight*3) > 6000 ) // about 100 blocks if ( (minage= nHeight*3) > 6000 ) // about 100 blocks
minage = 6000; minage = 6000;
pindex = 0; pindex = 0;