This commit is contained in:
jl777
2016-10-25 19:59:34 -03:00
parent a4cbda932c
commit 2c6bdd83ed

View File

@@ -15,7 +15,7 @@
void komodo_gateway_iteration(char *symbol)
{
char *retstr; static uint32_t r,n,counter=0;
char *retstr; int32_t i,num; cJSON *item,*listobj; static uint32_t r,n,counter=0;
if ( r == 0 )
r = rand();
if ( (counter++ % 10) == (r % 10) )
@@ -25,6 +25,23 @@ void komodo_gateway_iteration(char *symbol)
{
//printf("GETINFO from.%s (%s)\n",ASSETCHAINS_SYMBOL,retstr);
free(retstr);
if ( (retstr= komodo_issuemethod((char *)"listtransactions",0,7771)) != 0 )
{
//printf("LIST.(%s)\n",retstr);
if ( (listobj= cJSON_Parse(retstr)) != 0 )
{
if ( (num= cJSON_GetArraySize(listobj)) > 0 )
{
for (i=0; i<num; i++)
{
item = jitem(listobj,i);
printf("%d.(%s)\n",i,jprint(item,0));
}
}
free_json(listobj);
}
free(retstr);
}
n++;
} else printf("error from %s\n",symbol);
}