|
|
|
|
@@ -1253,95 +1253,6 @@ uint32_t komodo_stakehash(uint256 *hashp,char *address,uint8_t *hashbuf,uint256
|
|
|
|
|
return(addrhash.uints[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_t vout,uint32_t blocktime,uint32_t prevtime,char *destaddr)
|
|
|
|
|
{
|
|
|
|
|
bool fNegative,fOverflow; uint8_t hashbuf[256]; char address[64]; bits256 addrhash; arith_uint256 hashval,mindiff,ratio,coinage256; uint256 hash,pasthash; int32_t diff=0,segid,minage,i,iter=0; uint32_t txtime,segid32,winner = 0 ; uint64_t value,coinage;
|
|
|
|
|
txtime = komodo_txtime2(&value,txid,vout,address);
|
|
|
|
|
if ( validateflag == 0 )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"blocktime.%u -> ",blocktime);
|
|
|
|
|
if ( blocktime < prevtime+3 )
|
|
|
|
|
blocktime = prevtime+3;
|
|
|
|
|
if ( blocktime < GetAdjustedTime()-60 )
|
|
|
|
|
blocktime = GetAdjustedTime()+30;
|
|
|
|
|
//fprintf(stderr,"blocktime.%u txtime.%u\n",blocktime,txtime);
|
|
|
|
|
}
|
|
|
|
|
if ( value == 0 || txtime == 0 || blocktime == 0 || prevtime == 0 )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"komodo_stake null %.8f %u %u %u\n",dstr(value),txtime,blocktime,prevtime);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
if ( value < SATOSHIDEN )
|
|
|
|
|
return(0);
|
|
|
|
|
value /= SATOSHIDEN;
|
|
|
|
|
mindiff.SetCompact(STAKING_MIN_DIFF,&fNegative,&fOverflow);
|
|
|
|
|
ratio = (mindiff / bnTarget);
|
|
|
|
|
if ( (minage= nHeight*3) > 6000 ) // about 100 blocks
|
|
|
|
|
minage = 6000;
|
|
|
|
|
komodo_segids(hashbuf,nHeight-101,100);
|
|
|
|
|
segid32 = komodo_stakehash(&hash,address,hashbuf,txid,vout);
|
|
|
|
|
segid = ((nHeight + segid32) & 0x3f);
|
|
|
|
|
for (iter=0; iter<600; iter++)
|
|
|
|
|
{
|
|
|
|
|
if ( blocktime+iter+segid*2 < txtime+minage )
|
|
|
|
|
continue;
|
|
|
|
|
diff = (iter + blocktime - txtime - minage);
|
|
|
|
|
if ( diff < 0 )
|
|
|
|
|
diff = 60;
|
|
|
|
|
else if ( diff > 3600*24*30 )
|
|
|
|
|
{
|
|
|
|
|
//printf("diff.%d (iter.%d blocktime.%u txtime.%u minage.%d)\n",(int32_t)diff,iter,blocktime,txtime,(int32_t)minage);
|
|
|
|
|
diff = 3600*24*30;
|
|
|
|
|
}
|
|
|
|
|
if ( iter > 0 )
|
|
|
|
|
diff += segid*2;
|
|
|
|
|
coinage = (value * diff);
|
|
|
|
|
if ( ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV2 )
|
|
|
|
|
{
|
|
|
|
|
if ( blocktime+iter+segid*2 > prevtime+200 )
|
|
|
|
|
coinage *= ((blocktime+iter+segid*2) - (prevtime+120));
|
|
|
|
|
}
|
|
|
|
|
if ( blocktime+iter+segid*2 > prevtime+480 )
|
|
|
|
|
coinage *= ((blocktime+iter+segid*2) - (prevtime+400));
|
|
|
|
|
coinage256 = arith_uint256(coinage+1);
|
|
|
|
|
hashval = ratio * (UintToArith256(hash) / coinage256);
|
|
|
|
|
if ( hashval <= bnTarget )
|
|
|
|
|
{
|
|
|
|
|
winner = 1;
|
|
|
|
|
if ( validateflag == 0 )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"winner blocktime.%u iter.%d segid.%d\n",blocktime,iter,segid);
|
|
|
|
|
blocktime += iter;
|
|
|
|
|
blocktime += segid * 2;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if ( validateflag != 0 )
|
|
|
|
|
{
|
|
|
|
|
/*for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);
|
|
|
|
|
fprintf(stderr," vs ");
|
|
|
|
|
for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]);
|
|
|
|
|
fprintf(stderr," segid.%d iter.%d winner.%d coinage.%llu %d ht.%d t.%u v%d diff.%d\n",segid,iter,winner,(long long)coinage,(int32_t)(blocktime - txtime),nHeight,blocktime,(int32_t)value,(int32_t)diff);*/
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//fprintf(stderr,"iterated until i.%d winner.%d\n",i,winner);
|
|
|
|
|
if ( 0 && validateflag != 0 )
|
|
|
|
|
{
|
|
|
|
|
for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);
|
|
|
|
|
fprintf(stderr," vs ");
|
|
|
|
|
for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]);
|
|
|
|
|
fprintf(stderr," segid.%d iter.%d winner.%d coinage.%llu %d ht.%d t.%u v%d diff.%d ht.%d\n",segid,iter,winner,(long long)coinage,(int32_t)(blocktime - txtime),nHeight,blocktime,(int32_t)value,(int32_t)diff,nHeight);
|
|
|
|
|
}
|
|
|
|
|
if ( nHeight < 10 )
|
|
|
|
|
return(blocktime);
|
|
|
|
|
return(blocktime * winner);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc)
|
|
|
|
|
{
|
|
|
|
|
int32_t oldflag = 0,dispflag = 1;
|
|
|
|
|
@@ -1380,7 +1291,17 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
|
|
|
|
fprintf(stderr," %d, ",percPoS);
|
|
|
|
|
}
|
|
|
|
|
if ( m+n < 100 )
|
|
|
|
|
percPoS = ((percPoS * n) + (goalperc * (100-n))) / 100;
|
|
|
|
|
{
|
|
|
|
|
// We do actual PoS % at the start. Requires coin distribution in first 10 blocks!
|
|
|
|
|
if ( ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV2 )
|
|
|
|
|
percPoS = (percPoS*100) / (m+n);
|
|
|
|
|
else
|
|
|
|
|
// This seems to be inverse. The actual PoS % is backwards in the first 100 blocks.
|
|
|
|
|
// I dont't understand the math here, or why its backwards, so I am just disabling it for VerusHash.
|
|
|
|
|
// No doubt this is probably wrong for equihash aswell, we may need to test an equihash chain with the rule above.
|
|
|
|
|
// Need to ask james what the deal is here! Seems to be causeing ALL the problems.
|
|
|
|
|
percPoS = ((percPoS * n) + (goalperc * (100-n))) / 100;
|
|
|
|
|
}
|
|
|
|
|
if ( dispflag != 0 && ASSETCHAINS_STAKED < 100 )
|
|
|
|
|
fprintf(stderr," -> %d%% percPoS vs goalperc.%d ht.%d\n",percPoS,goalperc,height);
|
|
|
|
|
*percPoSp = percPoS;
|
|
|
|
|
@@ -1444,9 +1365,104 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
|
|
|
|
return(bnTarget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_t vout,uint32_t blocktime,uint32_t prevtime,char *destaddr,int32_t PoSperc)
|
|
|
|
|
{
|
|
|
|
|
bool fNegative,fOverflow; uint8_t hashbuf[256]; char address[64]; bits256 addrhash; arith_uint256 hashval,mindiff,ratio,coinage256; uint256 hash,pasthash; int32_t diff=0,segid,minage,i,iter=0; uint32_t txtime,segid32,winner = 0 ; uint64_t value,coinage;
|
|
|
|
|
txtime = komodo_txtime2(&value,txid,vout,address);
|
|
|
|
|
if ( validateflag == 0 )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"blocktime.%u -> ",blocktime);
|
|
|
|
|
if ( blocktime < prevtime+3 )
|
|
|
|
|
blocktime = prevtime+3;
|
|
|
|
|
if ( blocktime < GetAdjustedTime()-60 )
|
|
|
|
|
blocktime = GetAdjustedTime()+30;
|
|
|
|
|
//fprintf(stderr,"blocktime.%u txtime.%u\n",blocktime,txtime);
|
|
|
|
|
}
|
|
|
|
|
if ( value == 0 || txtime == 0 || blocktime == 0 || prevtime == 0 )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"komodo_stake null %.8f %u %u %u\n",dstr(value),txtime,blocktime,prevtime);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
if ( value < SATOSHIDEN )
|
|
|
|
|
return(0);
|
|
|
|
|
value /= SATOSHIDEN;
|
|
|
|
|
mindiff.SetCompact(STAKING_MIN_DIFF,&fNegative,&fOverflow);
|
|
|
|
|
ratio = (mindiff / bnTarget);
|
|
|
|
|
if ( (minage= nHeight*3) > 6000 ) // about 100 blocks
|
|
|
|
|
minage = 6000;
|
|
|
|
|
komodo_segids(hashbuf,nHeight-101,100);
|
|
|
|
|
segid32 = komodo_stakehash(&hash,address,hashbuf,txid,vout);
|
|
|
|
|
segid = ((nHeight + segid32) & 0x3f);
|
|
|
|
|
for (iter=0; iter<600; iter++)
|
|
|
|
|
{
|
|
|
|
|
if ( blocktime+iter+segid*2 < txtime+minage )
|
|
|
|
|
continue;
|
|
|
|
|
diff = (iter + blocktime - txtime - minage);
|
|
|
|
|
if ( diff < 0 )
|
|
|
|
|
diff = 60;
|
|
|
|
|
else if ( diff > 3600*24*30 )
|
|
|
|
|
{
|
|
|
|
|
//printf("diff.%d (iter.%d blocktime.%u txtime.%u minage.%d)\n",(int32_t)diff,iter,blocktime,txtime,(int32_t)minage);
|
|
|
|
|
diff = 3600*24*30;
|
|
|
|
|
}
|
|
|
|
|
if ( iter > 0 )
|
|
|
|
|
diff += segid*2;
|
|
|
|
|
coinage = (value * diff);
|
|
|
|
|
if ( ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV2 )
|
|
|
|
|
{
|
|
|
|
|
fprintf(stderr, "PoS % is: %i% vs. %i% \n", PoSperc, ASSETCHAINS_STAKED);
|
|
|
|
|
if ( PoSperc < ASSETCHAINS_STAKED )
|
|
|
|
|
{
|
|
|
|
|
// This means we are under PoS % required and we need some extra help getting an elegible utxo.
|
|
|
|
|
// Likley there is some math required here to make it work properly. But getting the data here is no1 priority.
|
|
|
|
|
coinage = coinage * 1000;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// leave this here for now...
|
|
|
|
|
if ( blocktime+iter+segid*2 > prevtime+480 )
|
|
|
|
|
coinage *= ((blocktime+iter+segid*2) - (prevtime+400));
|
|
|
|
|
coinage256 = arith_uint256(coinage+1);
|
|
|
|
|
hashval = ratio * (UintToArith256(hash) / coinage256);
|
|
|
|
|
if ( hashval <= bnTarget )
|
|
|
|
|
{
|
|
|
|
|
winner = 1;
|
|
|
|
|
if ( validateflag == 0 )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"winner blocktime.%u iter.%d segid.%d\n",blocktime,iter,segid);
|
|
|
|
|
blocktime += iter;
|
|
|
|
|
blocktime += segid * 2;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if ( validateflag != 0 )
|
|
|
|
|
{
|
|
|
|
|
/*for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);
|
|
|
|
|
fprintf(stderr," vs ");
|
|
|
|
|
for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]);
|
|
|
|
|
fprintf(stderr," segid.%d iter.%d winner.%d coinage.%llu %d ht.%d t.%u v%d diff.%d\n",segid,iter,winner,(long long)coinage,(int32_t)(blocktime - txtime),nHeight,blocktime,(int32_t)value,(int32_t)diff);*/
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//fprintf(stderr,"iterated until i.%d winner.%d\n",i,winner);
|
|
|
|
|
if ( 0 && validateflag != 0 )
|
|
|
|
|
{
|
|
|
|
|
for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);
|
|
|
|
|
fprintf(stderr," vs ");
|
|
|
|
|
for (i=31; i>=24; i--)
|
|
|
|
|
fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]);
|
|
|
|
|
fprintf(stderr," segid.%d iter.%d winner.%d coinage.%llu %d ht.%d t.%u v%d diff.%d ht.%d\n",segid,iter,winner,(long long)coinage,(int32_t)(blocktime - txtime),nHeight,blocktime,(int32_t)value,(int32_t)diff,nHeight);
|
|
|
|
|
}
|
|
|
|
|
if ( nHeight < 10 )
|
|
|
|
|
return(blocktime);
|
|
|
|
|
return(blocktime * winner);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_uint256 bnTarget,arith_uint256 bhash)
|
|
|
|
|
{
|
|
|
|
|
CBlockIndex *previndex,*pindex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,PoSperc,txn_count,eligible=0,isPoS = 0,segid; uint64_t value; CTxDestination voutaddress;
|
|
|
|
|
CBlockIndex *previndex,*pindex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,PoSperc,txn_count,eligible=0,isPoS = 0,segid; uint64_t value; CTxDestination voutaddress; arith_uint256 POWTarget;
|
|
|
|
|
if ( ASSETCHAINS_STAKED == 100 && height <= 100 )
|
|
|
|
|
return(1);
|
|
|
|
|
BlockMap::const_iterator it = mapBlockIndex.find(pblock->GetHash());
|
|
|
|
|
@@ -1457,6 +1473,8 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
|
|
|
|
|
return(0);
|
|
|
|
|
else return(1);
|
|
|
|
|
}
|
|
|
|
|
// Get PoSperc and POW Target. for later.
|
|
|
|
|
POWTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED);
|
|
|
|
|
txn_count = pblock->vtx.size();
|
|
|
|
|
if ( txn_count > 1 && pblock->vtx[txn_count-1].vin.size() == 1 && pblock->vtx[txn_count-1].vout.size() == 1 )
|
|
|
|
|
{
|
|
|
|
|
@@ -1470,7 +1488,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
|
|
|
|
|
{
|
|
|
|
|
if ( komodo_isPoS(pblock) != 0 )
|
|
|
|
|
{
|
|
|
|
|
eligible = komodo_stake(1,bnTarget,height,txid,vout,pblock->nTime,prevtime+27,(char *)"");
|
|
|
|
|
eligible = komodo_stake(1,bnTarget,height,txid,vout,pblock->nTime,prevtime+27,(char *)"",PoSperc);
|
|
|
|
|
}
|
|
|
|
|
if ( eligible == 0 || eligible > pblock->nTime )
|
|
|
|
|
{
|
|
|
|
|
@@ -1515,8 +1533,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bnTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED);
|
|
|
|
|
if ( bhash < bnTarget )
|
|
|
|
|
if ( bhash < POWTarget )
|
|
|
|
|
{
|
|
|
|
|
//fprintf(stderr,"ht.%d isPoS but meets PoW diff!\n",height);
|
|
|
|
|
isPoS = 0;
|
|
|
|
|
@@ -2085,10 +2102,11 @@ uint32_t komodo_eligible(arith_uint256 bnTarget,arith_uint256 ratio,struct komod
|
|
|
|
|
int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blocktimep,uint32_t *txtimep,uint256 *utxotxidp,int32_t *utxovoutp,uint64_t *utxovaluep,uint8_t *utxosig)
|
|
|
|
|
{
|
|
|
|
|
static struct komodo_staking *array; static int32_t numkp,maxkp; static uint32_t lasttime;
|
|
|
|
|
set<CBitcoinAddress> setAddress; struct komodo_staking *kp; int32_t winners,segid,minage,nHeight,counter=0,i,m,siglen=0,nMinDepth = 1,nMaxDepth = 99999999; vector<COutput> vecOutputs; uint32_t block_from_future_rejecttime,besttime,eligible,eligible2,earliest = 0; CScript best_scriptPubKey; arith_uint256 mindiff,ratio,bnTarget; CBlockIndex *tipindex,*pindex; CTxDestination address; bool fNegative,fOverflow; uint8_t hashbuf[256]; CTransaction tx; uint256 hashBlock;
|
|
|
|
|
int32_t PoSperc;
|
|
|
|
|
set<CBitcoinAddress> setAddress; struct komodo_staking *kp; int32_t winners,segid,minage,nHeight,counter=0,i,m,siglen=0,nMinDepth = 1,nMaxDepth = 99999999; vector<COutput> vecOutputs; uint32_t block_from_future_rejecttime,besttime,eligible,eligible2,earliest = 0; CScript best_scriptPubKey; arith_uint256 mindiff,ratio,bnTarget,tmpTarget; CBlockIndex *tipindex,*pindex; CTxDestination address; bool fNegative,fOverflow; uint8_t hashbuf[256]; CTransaction tx; uint256 hashBlock;
|
|
|
|
|
if (!EnsureWalletIsAvailable(0))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
|
|
|
|
mindiff.SetCompact(STAKING_MIN_DIFF,&fNegative,&fOverflow);
|
|
|
|
|
ratio = (mindiff / bnTarget);
|
|
|
|
|
@@ -2100,6 +2118,8 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
|
|
|
|
|
if ( (tipindex= chainActive.Tip()) == 0 )
|
|
|
|
|
return(0);
|
|
|
|
|
nHeight = tipindex->GetHeight() + 1;
|
|
|
|
|
// Get the PoS% so we can pass it to komodo_stake, this is to adjust PoS dofficulty when it is under the target %!
|
|
|
|
|
tmpTarget = komodo_PoWtarget(&PoSperc,bnTarget,nHeight,ASSETCHAINS_STAKED);
|
|
|
|
|
if ( (minage= nHeight*3) > 6000 ) // about 100 blocks
|
|
|
|
|
minage = 6000;
|
|
|
|
|
komodo_segids(hashbuf,nHeight-101,100);
|
|
|
|
|
@@ -2119,7 +2139,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( time(NULL) > lasttime+600 || array == 0 || resetstaker )
|
|
|
|
|
if ( resetstaker || array == 0 || time(NULL) > lasttime+600 )
|
|
|
|
|
{
|
|
|
|
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
|
|
|
|
pwalletMain->AvailableCoins(vecOutputs, false, NULL, true);
|
|
|
|
|
@@ -2175,14 +2195,14 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
|
|
|
|
|
kp = &array[i];
|
|
|
|
|
if ( (eligible2= komodo_eligible(bnTarget,ratio,kp,nHeight,*blocktimep,(uint32_t)tipindex->nTime+27,minage,hashbuf)) == 0 )
|
|
|
|
|
continue;
|
|
|
|
|
eligible = komodo_stake(0,bnTarget,nHeight,kp->txid,kp->vout,0,(uint32_t)tipindex->nTime+27,kp->address);
|
|
|
|
|
eligible = komodo_stake(0,bnTarget,nHeight,kp->txid,kp->vout,0,(uint32_t)tipindex->nTime+27,kp->address,PoSperc);
|
|
|
|
|
//fprintf(stderr,"i.%d %u vs %u\n",i,eligible2,eligible);
|
|
|
|
|
if ( eligible > 0 )
|
|
|
|
|
{
|
|
|
|
|
besttime = m = 0;
|
|
|
|
|
if ( eligible == komodo_stake(1,bnTarget,nHeight,kp->txid,kp->vout,eligible,(uint32_t)tipindex->nTime+27,kp->address) )
|
|
|
|
|
if ( eligible == komodo_stake(1,bnTarget,nHeight,kp->txid,kp->vout,eligible,(uint32_t)tipindex->nTime+27,kp->address,PoSperc) )
|
|
|
|
|
{
|
|
|
|
|
while ( eligible == komodo_stake(1,bnTarget,nHeight,kp->txid,kp->vout,eligible,(uint32_t)tipindex->nTime+27,kp->address) )
|
|
|
|
|
while ( eligible == komodo_stake(1,bnTarget,nHeight,kp->txid,kp->vout,eligible,(uint32_t)tipindex->nTime+27,kp->address,PoSperc) )
|
|
|
|
|
{
|
|
|
|
|
besttime = eligible;
|
|
|
|
|
eligible--;
|
|
|
|
|
|