Fix miner

This commit is contained in:
jl777
2019-03-28 04:23:13 -11:00
parent 4b62adba68
commit f6a5c6970b
2 changed files with 27 additions and 23 deletions

View File

@@ -2067,7 +2067,7 @@ void komodo_args(char *argv0)
if ( ASSETCHAINS_CBOPRET != 0 )
{
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_CBOPRET),(void *)&ASSETCHAINS_CBOPRET);
komodo_cbopretupdate();
komodo_cbopretupdate(); // will set Mineropret
fprintf(stderr,"This blockchain uses data produced from CoinDesk Bitcoin Price Index\n");
}
}

View File

@@ -648,6 +648,9 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
else if ( nHeight > 1 && ASSETCHAINS_SYMBOL[0] != 0 && (ASSETCHAINS_CBOPRET != 0 ||(ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1) && (ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0) && (commission= komodo_commission((CBlock*)&pblocktemplate->block,(int32_t)nHeight)) != 0) )
{
int32_t i; uint8_t *ptr;
if ( commission != 0 )
{
fprintf(stderr,"nonzero commission %.8f\n",(double)commission/COIN);
txNew.vout.resize(2);
txNew.vout[1].nValue = commission;
if ( ASSETCHAINS_SCRIPTPUB.size() > 1 )
@@ -673,12 +676,13 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
ptr[34] = OP_CHECKSIG;
//fprintf(stderr," set ASSETCHAINS_OVERRIDE_PUBKEY33 into vout[1]\n");
}
}
if ( ASSETCHAINS_CBOPRET != 0 )
{
txNew.vout.resize(txNew.vout.size()+1);
txNew.vout[txNew.vout.size()-1].scriptPubKey = komodo_mineropret(nHeight);
}
//printf("autocreate commision vout\n");
printf("autocreate commision/cbopret.%lld vout[%d]\n",(long long)ASSETCHAINS_CBOPRET,(int32_t)txNew.vout.size());
}
else if ( (uint64_t)(txNew.vout[0].nValue) >= ASSETCHAINS_TIMELOCKGTE)
{