From 3f083c258de50ce5db2d6ae59c1c9d8956f916ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Nov 2016 21:13:41 -0300 Subject: [PATCH] test --- src/bitcoind.cpp | 3 +++ src/komodo_gateway.h | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 41773381f..b5dac427a 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -34,6 +34,7 @@ static bool fDaemon; extern char ASSETCHAINS_SYMBOL[16]; void komodo_gateway_iteration(char *symbol); +void komodo_iteration(char *symbol); void WaitForShutdown(boost::thread_group* threadGroup) { @@ -44,6 +45,8 @@ void WaitForShutdown(boost::thread_group* threadGroup) MilliSleep(2000); if ( ASSETCHAINS_SYMBOL[0] != 0 ) komodo_gateway_iteration(ASSETCHAINS_SYMBOL); + else komodo_iteration("EUR"); + fShutdown = ShutdownRequested(); } if (threadGroup) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 7e3219cea..83005cd88 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -466,11 +466,16 @@ void komodo_gateway_iteration(char *symbol) sleep(30); } KOMODO_DEPOSIT = komodo_paxtotal(); +} + +void komodo_iteration(char *symbol) +{ + char *retstr,*base,*coinaddr,*txidstr,cmd[512]; uint64_t value,fiatoshis; cJSON *array,*item; int32_t i,n,vout,shortflag,height; uint256 txid; uint8_t rmd160[20],addrtype; if ( ASSETCHAINS_SYMBOL[0] == 0 ) { //[{"prev_hash":"5d5c9a49489b558de9e84f991f996dedaae6b9d0f157f82b2fec64662476d5cf","prev_vout":2,"EUR":0.78329000,"fiat":"EUR","height":57930,"KMD":0.10000000,"address":"RDhEGYScNQYetCyG75Kf8Fg61UWPdwc1C5"}] - char *retstr,*base,*coinaddr,*txidstr; uint64_t value,fiatoshis; cJSON *array,*item; int32_t n,vout,shortflag,height; uint256 txid; uint8_t rmd160[20],addrtype; - if ( (retstr= issue_curl("{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"EUR\"}")) != 0 ) + sprintf(cmd,"{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"%s\"}",symbol); + if ( (retstr= issue_curl(cmd)) != 0 ) { if ( (array= cJSON_Parse(retstr)) != 0 ) {