diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 353dc0624..2a49991c8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -160,7 +160,7 @@ int32_t komodo_issued_opreturn(uint8_t *shortflagp,char *base,uint256 *txids,uin return(n); } -void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol,int32_t tokomodo) +int32_t komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol,int32_t tokomodo) { struct pax_transaction *pax,*tmp; uint8_t *script,opcode,opret[10000],data[10000]; int32_t i,len=0,opretlen=0,numvouts=1; PENDING_KOMODO_TX = 0; @@ -225,7 +225,9 @@ void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char * script = (uint8_t *)&txNew->vout[numvouts].scriptPubKey[0]; memcpy(script,opret,opretlen); printf("MINER deposits.%d (%s) vouts.%d %.8f opretlen.%d\n",tokomodo,ASSETCHAINS_SYMBOL,numvouts,dstr(PENDING_KOMODO_TX),opretlen); + return(1); } + return(0); } int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing diff --git a/src/miner.cpp b/src/miner.cpp index a3a4814f5..29d951d45 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -102,7 +102,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize); uint64_t komodo_paxtotal(); int32_t komodo_is_issuer(); -void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol,int32_t tokomodo); +int32_t komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol,int32_t tokomodo); extern int32_t KOMODO_INITDONE,ASSETCHAINS_SHORTFLAG,KOMODO_REALTIME; extern char ASSETCHAINS_SYMBOL[16]; @@ -367,17 +367,19 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if ( ASSETCHAINS_SYMBOL[0] == 0 ) { int32_t i,opretlen; uint8_t opret[256],*ptr; - if ( (opretlen= komodo_pax_opreturn(opret,sizeof(opret))) > 0 ) + if ( komodo_gateway_deposits(&txNew,0,(char *)"EUR",1) == 0 ) { - txNew.vout.resize(2); - txNew.vout[1].scriptPubKey.resize(opretlen); - ptr = (uint8_t *)txNew.vout[1].scriptPubKey.data(); - for (i=0; i 0 ) + { + txNew.vout.resize(2); + txNew.vout[1].scriptPubKey.resize(opretlen); + ptr = (uint8_t *)txNew.vout[1].scriptPubKey.data(); + for (i=0; i