Stake best utxo

This commit is contained in:
jl777
2018-06-01 06:25:31 -11:00
parent 3753f56834
commit a2ec2aaad2

View File

@@ -415,14 +415,14 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
if ( (siglen= komodo_staked(txStaked,pblock->nBits,&blocktime,&txtime,&utxotxid,&utxovout,&utxovalue,utxosig)) > 0 ) if ( (siglen= komodo_staked(txStaked,pblock->nBits,&blocktime,&txtime,&utxotxid,&utxovout,&utxovalue,utxosig)) > 0 )
{ {
CAmount txfees = 0; CAmount txfees = 0;
if ( GetAdjustedTime() < blocktime-13 ) if ( (int32_t)chainActive.Tip()->nHeight+1 > 100 && GetAdjustedTime() < blocktime-13 )
return(0); return(0);
pblock->vtx.push_back(txStaked); pblock->vtx.push_back(txStaked);
pblocktemplate->vTxFees.push_back(txfees); pblocktemplate->vTxFees.push_back(txfees);
pblocktemplate->vTxSigOps.push_back(GetLegacySigOpCount(txStaked)); pblocktemplate->vTxSigOps.push_back(GetLegacySigOpCount(txStaked));
nFees += txfees; nFees += txfees;
pblock->nTime = blocktime; pblock->nTime = blocktime;
//printf("PoS ht.%d t%u\n",(int32_t)chainActive.Tip()->nHeight+1,blocktime); printf("staking PoS ht.%d t%u lag.%u\n",(int32_t)chainActive.Tip()->nHeight+1,blocktime,GetAdjustedTime() - (blocktime-13));
} else return(0); //fprintf(stderr,"no utxos eligible for staking\n"); } else return(0); //fprintf(stderr,"no utxos eligible for staking\n");
} }