This commit is contained in:
jl777
2018-06-30 03:40:02 -11:00
parent 2732d384f4
commit f2c1ac0671
2 changed files with 14 additions and 8 deletions

View File

@@ -1181,22 +1181,25 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
hashval = UintToArith256(pindex->GetBlockHash()); hashval = UintToArith256(pindex->GetBlockHash());
if ( hashval <= bnTarget ) // PoW is never as easy as PoS/16, some PoS will be counted as PoW if ( hashval <= bnTarget ) // PoW is never as easy as PoS/16, some PoS will be counted as PoW
{ {
fprintf(stderr,"1"); if ( ASSETCHAINS_STAKED < 100 )
fprintf(stderr,"1");
sum += hashval; sum += hashval;
n++; n++;
} }
else else
{ {
percPoS++; percPoS++;
fprintf(stderr,"0"); if ( ASSETCHAINS_STAKED < 100 )
fprintf(stderr,"0");
} }
if ( (i % 10) == 9 ) if ( ASSETCHAINS_STAKED < 100 && (i % 10) == 9 )
fprintf(stderr," %d, ",percPoS); fprintf(stderr," %d, ",percPoS);
} }
} }
if ( n < 100 ) if ( n < 100 )
percPoS = ((percPoS * n) + (goalperc * (100-n))) / 100; percPoS = ((percPoS * n) + (goalperc * (100-n))) / 100;
fprintf(stderr," -> %d%% percPoS vs goalperc.%d ht.%d\n",percPoS,goalperc,height); if ( ASSETCHAINS_STAKED < 100 )
fprintf(stderr," -> %d%% percPoS vs goalperc.%d ht.%d\n",percPoS,goalperc,height);
*percPoSp = percPoS; *percPoSp = percPoS;
target = (target / arith_uint256(KOMODO_POWMINMULT)); target = (target / arith_uint256(KOMODO_POWMINMULT));
if ( n > 0 ) if ( n > 0 )
@@ -1208,7 +1211,7 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
if ( percPoS < goalperc ) // increase PoW diff -> lower bnTarget if ( percPoS < goalperc ) // increase PoW diff -> lower bnTarget
{ {
bnTarget = (ave * arith_uint256(percPoS * percPoS)) / arith_uint256(goalperc * goalperc * goalperc); bnTarget = (ave * arith_uint256(percPoS * percPoS)) / arith_uint256(goalperc * goalperc * goalperc);
if ( 1 ) if ( ASSETCHAINS_STAKED < 100 )
{ {
for (i=31; i>=24; i--) for (i=31; i>=24; i--)
fprintf(stderr,"%02x",((uint8_t *)&ave)[i]); fprintf(stderr,"%02x",((uint8_t *)&ave)[i]);

View File

@@ -920,9 +920,12 @@ 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);
for (z=31; z>=0; z--) if ( ASSETCHAINS_STAKED < 100 )
fprintf(stderr,"%02x",((uint8_t *)&HASHTarget_POW)[z]); {
fprintf(stderr," PoW for staked coin PoS %d%% vs target %d%%\n",percPoS,(int32_t)ASSETCHAINS_STAKED); for (z=31; z>=0; z--)
fprintf(stderr,"%02x",((uint8_t *)&HASHTarget_POW)[z]);
fprintf(stderr," PoW for staked coin PoS %d%% vs target %d%%\n",percPoS,(int32_t)ASSETCHAINS_STAKED);
}
} }
while (true) while (true)
{ {