From e3c6793ef1564dab84425fc20ac1d6bf0b1829b1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 4 Mar 2017 02:09:21 +0200 Subject: [PATCH] Test --- basilisk/jumblr.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/basilisk/jumblr.c b/basilisk/jumblr.c index f4126d628..8ab873903 100755 --- a/basilisk/jumblr.c +++ b/basilisk/jumblr.c @@ -102,14 +102,14 @@ char *jumblr_sendz_to_t(struct supernet_info *myinfo,struct iguana_info *coin,ch char *jumblr_zlistreceivedbyaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *addr) { char params[1024]; - sprintf(params,"[\"%s\", 1]",addr); + sprintf(params,"[\"%s\", 3]",addr); return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"z_listreceivedbyaddress",params)); } char *jumblr_getreceivedbyaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *addr) { char params[1024]; - sprintf(params,"[\"%s\", 1]",addr); + sprintf(params,"[\"%s\", 3]",addr); return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"getreceivedbyaddress",params)); } @@ -123,10 +123,17 @@ char *jumblr_importprivkey(struct supernet_info *myinfo,struct iguana_info *coin char *jumblr_zgetbalance(struct supernet_info *myinfo,struct iguana_info *coin,char *addr) { char params[1024]; - sprintf(params,"[\"%s\", 1]",addr); + sprintf(params,"[\"%s\", 3]",addr); return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"z_getbalance",params)); } +char *jumblr_getbalance(struct supernet_info *myinfo,struct iguana_info *coin,char *addr) +{ + char params[1024]; + sprintf(params,"[\"%s\", 3]",addr); + return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"getbalance",params)); +} + int64_t jumblr_receivedby(struct supernet_info *myinfo,struct iguana_info *coin,char *addr) { char *retstr; int64_t total = 0; //cJSON *retjson,*item; int32_t i,n; @@ -153,16 +160,13 @@ int64_t jumblr_receivedby(struct supernet_info *myinfo,struct iguana_info *coin, int64_t jumblr_balance(struct supernet_info *myinfo,struct iguana_info *coin,char *addr) { - char *retstr; double val; cJSON *retjson; int64_t balance = 0; + char *retstr; double val; int64_t balance = 0; if ( strlen(addr) < 40 ) { - if ( (retstr= _dex_getbalance(myinfo,coin->symbol,addr)) != 0 ) + if ( (retstr= jumblr_getbalance(myinfo,coin,addr)) != 0 ) { - if ( (retjson= cJSON_Parse(retstr)) != 0 ) - { - balance = jdouble(retjson,"balance") * SATOSHIDEN; - free_json(retjson); - } + if ( (val= atof(retstr)) > SMALLVAL ) + balance = val * SATOSHIDEN; free(retstr); } }