Test
This commit is contained in:
@@ -1564,7 +1564,7 @@ void komodo_args(char *argv0)
|
|||||||
}
|
}
|
||||||
if ( ASSETCHAINS_ENDSUBSIDY != 0 || ASSETCHAINS_REWARD != 0 || ASSETCHAINS_HALVING != 0 || ASSETCHAINS_DECAY != 0 || ASSETCHAINS_COMMISSION != 0 )
|
if ( ASSETCHAINS_ENDSUBSIDY != 0 || ASSETCHAINS_REWARD != 0 || ASSETCHAINS_HALVING != 0 || ASSETCHAINS_DECAY != 0 || ASSETCHAINS_COMMISSION != 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"end.%llu reward.%llu halving.%llu decay.%llu perc.%llu\n",(long long)ASSETCHAINS_ENDSUBSIDY,(long long)ASSETCHAINS_REWARD,(long long)ASSETCHAINS_HALVING,(long long)ASSETCHAINS_DECAY,(long long)ASSETCHAINS_COMMISSION);
|
fprintf(stderr,"end.%llu reward.%llu halving.%llu decay.%llu perc %.4f [%02x]\n",(long long)ASSETCHAINS_ENDSUBSIDY,(long long)ASSETCHAINS_REWARD,(long long)ASSETCHAINS_HALVING,(long long)ASSETCHAINS_DECAY,dstr(ASSETCHAINS_COMMISSION)*100,ASSETCHAINS_OVERRIDE_PUBKEY33[0]);
|
||||||
extraptr = extrabuf;
|
extraptr = extrabuf;
|
||||||
memcpy(extraptr,ASSETCHAINS_OVERRIDE_PUBKEY33,33), extralen = 33;
|
memcpy(extraptr,ASSETCHAINS_OVERRIDE_PUBKEY33,33), extralen = 33;
|
||||||
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_ENDSUBSIDY),(void *)&ASSETCHAINS_ENDSUBSIDY);
|
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_ENDSUBSIDY),(void *)&ASSETCHAINS_ENDSUBSIDY);
|
||||||
|
|||||||
@@ -396,18 +396,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
// Add fees
|
// Add fees
|
||||||
txNew.vout[0].nValue += nFees;
|
txNew.vout[0].nValue += nFees;
|
||||||
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
|
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 && ASSETCHAINS_COMMISSION != 0 && (commission= komodo_commission(*pblock)) != 0 )
|
|
||||||
{
|
|
||||||
int32_t i; uint8_t *ptr;
|
|
||||||
txNew.vout.resize(2);
|
|
||||||
txNew.vout[1].nValue = commission;
|
|
||||||
txNew.vout[1].scriptPubKey.resize(35);
|
|
||||||
ptr = (uint8_t *)txNew.vout[1].scriptPubKey.data();
|
|
||||||
ptr[0] = 33;
|
|
||||||
for (i=0; i<33; i++)
|
|
||||||
ptr[i+1] = ASSETCHAINS_OVERRIDE_PUBKEY33[i];
|
|
||||||
ptr[34] = OP_CHECKSIG;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
/*if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||||
{
|
{
|
||||||
@@ -434,6 +422,19 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
pblock->vtx[0] = txNew;
|
pblock->vtx[0] = txNew;
|
||||||
|
if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 && ASSETCHAINS_COMMISSION != 0 && (commission= komodo_commission(pblocktemplate->block)) != 0 )
|
||||||
|
{
|
||||||
|
int32_t i; uint8_t *ptr;
|
||||||
|
txNew.vout.resize(2);
|
||||||
|
txNew.vout[1].nValue = commission;
|
||||||
|
txNew.vout[1].scriptPubKey.resize(35);
|
||||||
|
ptr = (uint8_t *)txNew.vout[1].scriptPubKey.data();
|
||||||
|
ptr[0] = 33;
|
||||||
|
for (i=0; i<33; i++)
|
||||||
|
ptr[i+1] = ASSETCHAINS_OVERRIDE_PUBKEY33[i];
|
||||||
|
ptr[34] = OP_CHECKSIG;
|
||||||
|
printf("autocreate commision vout\n");
|
||||||
|
}
|
||||||
pblocktemplate->vTxFees[0] = -nFees;
|
pblocktemplate->vTxFees[0] = -nFees;
|
||||||
// Randomise nonce
|
// Randomise nonce
|
||||||
arith_uint256 nonce = UintToArith256(GetRandHash());
|
arith_uint256 nonce = UintToArith256(GetRandHash());
|
||||||
|
|||||||
Reference in New Issue
Block a user