This commit is contained in:
jl777
2016-10-29 17:21:29 -03:00
parent bbf6ba6155
commit c9b1071dce

View File

@@ -99,6 +99,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams,
} }
int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize); int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize);
void komodo_gateway_deposits(CMutableTransaction& txNew);
extern int32_t KOMODO_INITDONE; extern int32_t KOMODO_INITDONE;
extern uint64_t KOMODO_DEPOSIT; extern uint64_t KOMODO_DEPOSIT;
extern char ASSETCHAINS_SYMBOL[16]; extern char ASSETCHAINS_SYMBOL[16];
@@ -351,6 +352,13 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
//txNew.nLockTime = (uint32_t)time(NULL) - 60; //txNew.nLockTime = (uint32_t)time(NULL) - 60;
txNew.vin.resize(1); txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull(); txNew.vin[0].prevout.SetNull();
txNew.vout[0].scriptPubKey = scriptPubKeyIn;
txNew.vout[0].nValue = GetBlockSubsidy(nHeight,chainparams.GetConsensus());
// Add fees
txNew.vout[0].nValue += nFees;
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
if ( ASSETCHAINS_SYMBOL[0] == 0 )
{
int32_t i,opretlen; uint8_t opret[256],*ptr; int32_t i,opretlen; uint8_t opret[256],*ptr;
if ( (opretlen= komodo_pax_opreturn(opret,sizeof(opret))) > 0 ) if ( (opretlen= komodo_pax_opreturn(opret,sizeof(opret))) > 0 )
{ {
@@ -362,12 +370,11 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
txNew.vout[1].nValue = 0; txNew.vout[1].nValue = 0;
//fprintf(stderr,"opretlen.%d\n",opretlen); //fprintf(stderr,"opretlen.%d\n",opretlen);
} else txNew.vout.resize(1); } else txNew.vout.resize(1);
txNew.vout[0].scriptPubKey = scriptPubKeyIn; }
txNew.vout[0].nValue = GetBlockSubsidy(nHeight, chainparams.GetConsensus()); else
// Add fees {
txNew.vout[0].nValue += nFees; komodo_gateway_deposits(txNew);
}
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
pblock->vtx[0] = txNew; pblock->vtx[0] = txNew;
pblocktemplate->vTxFees[0] = -nFees; pblocktemplate->vTxFees[0] = -nFees;