diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 5bdfbc126..6570f1bc9 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -413,7 +413,7 @@ ZERO_ARGS(InstantDEX,allcoins) STRING_ARG(InstantDEX,available,source) { - char *retstr; cJSON *vals,*balancejson,*retjson = 0; + char *retstr; uint64_t total = 0; int32_t i,n; cJSON *item,*vals,*unspents,*balancejson,*retjson = 0; if ( source != 0 && source[0] != 0 && (coin= iguana_coinfind(source)) != 0 ) { if ( myinfo->expiration != 0 ) @@ -423,11 +423,20 @@ STRING_ARG(InstantDEX,available,source) { 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 ( (unspents= jarray(&n,balancejson,"unspents")) != 0 ) + { + for (i=0; i