This commit is contained in:
jl777
2016-11-06 21:13:41 -03:00
parent e5e414c279
commit 3f083c258d
2 changed files with 10 additions and 2 deletions

View File

@@ -34,6 +34,7 @@
static bool fDaemon; static bool fDaemon;
extern char ASSETCHAINS_SYMBOL[16]; extern char ASSETCHAINS_SYMBOL[16];
void komodo_gateway_iteration(char *symbol); void komodo_gateway_iteration(char *symbol);
void komodo_iteration(char *symbol);
void WaitForShutdown(boost::thread_group* threadGroup) void WaitForShutdown(boost::thread_group* threadGroup)
{ {
@@ -44,6 +45,8 @@ void WaitForShutdown(boost::thread_group* threadGroup)
MilliSleep(2000); MilliSleep(2000);
if ( ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 )
komodo_gateway_iteration(ASSETCHAINS_SYMBOL); komodo_gateway_iteration(ASSETCHAINS_SYMBOL);
else komodo_iteration("EUR");
fShutdown = ShutdownRequested(); fShutdown = ShutdownRequested();
} }
if (threadGroup) if (threadGroup)

View File

@@ -466,11 +466,16 @@ void komodo_gateway_iteration(char *symbol)
sleep(30); sleep(30);
} }
KOMODO_DEPOSIT = komodo_paxtotal(); 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 ) if ( ASSETCHAINS_SYMBOL[0] == 0 )
{ {
//[{"prev_hash":"5d5c9a49489b558de9e84f991f996dedaae6b9d0f157f82b2fec64662476d5cf","prev_vout":2,"EUR":0.78329000,"fiat":"EUR","height":57930,"KMD":0.10000000,"address":"RDhEGYScNQYetCyG75Kf8Fg61UWPdwc1C5"}] //[{"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; sprintf(cmd,"{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"%s\"}",symbol);
if ( (retstr= issue_curl("{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"EUR\"}")) != 0 ) if ( (retstr= issue_curl(cmd)) != 0 )
{ {
if ( (array= cJSON_Parse(retstr)) != 0 ) if ( (array= cJSON_Parse(retstr)) != 0 )
{ {