|
@ -423,7 +423,7 @@ STRING_ARG(InstantDEX,available,source) |
|
|
{ |
|
|
{ |
|
|
if ( (retstr= basilisk_balances(myinfo,coin,0,0,GENESIS_PUBKEY,vals,"")) != 0 ) |
|
|
if ( (retstr= basilisk_balances(myinfo,coin,0,0,GENESIS_PUBKEY,vals,"")) != 0 ) |
|
|
{ |
|
|
{ |
|
|
printf("available.(%s)\n",retstr); |
|
|
//printf("available.(%s)\n",retstr);
|
|
|
if ( (balancejson= cJSON_Parse(retstr)) != 0 ) |
|
|
if ( (balancejson= cJSON_Parse(retstr)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (unspents= jarray(&n,balancejson,"unspents")) != 0 ) |
|
|
if ( (unspents= jarray(&n,balancejson,"unspents")) != 0 ) |
|
@ -434,17 +434,15 @@ STRING_ARG(InstantDEX,available,source) |
|
|
if ( jobj(item,"unspent") != 0 ) |
|
|
if ( jobj(item,"unspent") != 0 ) |
|
|
{ |
|
|
{ |
|
|
total += jdouble(item,"amount") * SATOSHIDEN; |
|
|
total += jdouble(item,"amount") * SATOSHIDEN; |
|
|
printf("(%s) -> %.8f\n",jprint(item,0),dstr(total)); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
//printf("(%s) -> %.8f\n",jprint(item,0),dstr(total));
|
|
|
} |
|
|
} |
|
|
} |
|
|
} else printf("no unspents in available\n"); |
|
|
if ( total == 0 ) |
|
|
|
|
|
total = 500000; |
|
|
|
|
|
retjson = cJSON_CreateObject(); |
|
|
retjson = cJSON_CreateObject(); |
|
|
jaddnum(retjson,"result",dstr(total)); |
|
|
jaddnum(retjson,"result",dstr(total)); |
|
|
free_json(balancejson); |
|
|
free_json(balancejson); |
|
|
printf("n.%d total %.8f (%s)\n",n,dstr(total),jprint(retjson,0)); |
|
|
printf("n.%d total %.8f (%s)\n",n,dstr(total),jprint(retjson,0)); |
|
|
} |
|
|
} else printf("parse error.(%s)\n",retstr); |
|
|
free(retstr); |
|
|
free(retstr); |
|
|
} |
|
|
} |
|
|
free_json(vals); |
|
|
free_json(vals); |
|
|