From 80671b17bd65d5b3ddb91ec8d06035acb0ac2a64 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 8 Nov 2018 09:36:56 -1100 Subject: [PATCH] Sendrawtransaction --- src/cc/dice.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index 8cfa3aef7..def8b932d 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -105,6 +105,7 @@ extern int32_t KOMODO_INSYNC; static uint256 bettxids[MAX_ENTROPYUSED],entropytxids[MAX_ENTROPYUSED][2]; // change to hashtable static CTransaction betTxs[MAX_ENTROPYUSED]; +static std::string DICE_ENTROPYTX; pthread_mutex_t DICE_MUTEX,DICEREVEALED_MUTEX; @@ -403,6 +404,15 @@ void *dicefinish(void *_ptr) } free(cmd); } + res = DICE_ENTROPYTX; + if ( res.empty() == 0 && res.size() > 64 ) + { + char cmdbuf[8192]; std::string res; + sprintf(cmdbuf,"./komodo-cli -ac_name=%s sendrawtransaction %s",ASSETCHAINS_SYMBOL,res.c_str()); + fprintf(stderr,"(%s)\n",cmdbuf); + if ( system(cmdbuf) != 0 ) + fprintf(stderr,"error (%s)\n",cmdbuf); + } } } if ( (newht= KOMODO_INSYNC) == 0 || newht == lastheight ) @@ -1523,6 +1533,7 @@ double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettx res = DiceAddfunding(txfee,planstr,fundingtxid,COIN/100); if ( res.empty() == 0 && res.size() > 64 && is_hexstr((char *)res.c_str(),0) > 64 ) { + DICE_ENTROPYTX = res; if ( DecodeHexTx(tx,res) != 0 ) { //LOCK(cs_main);