From 9aa65e53816b948cb350c72abd4e2961acb6a536 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 5 Dec 2017 12:58:25 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_rpc.c | 2 +- iguana/exchanges/LP_utxo.c | 6 ++++-- iguana/exchanges/supernet | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 77bf909e1..a89240311 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -394,7 +394,6 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi usecache = 0; else if ( G.LP_pendingswaps != 0 && time(NULL) > ap->unspenttime+1 ) usecache = 0; - printf("%s ap.%p unspent.%u usecache.%d iswatched.%d\n",coinaddr,ap,ap->unspenttime,usecache,LP_address_iswatched(symbol,coinaddr)); if ( usecache != 0 && (retstr= LP_unspents_filestr(symbol,coinaddr)) != 0 ) { retjson = cJSON_Parse(retstr); @@ -402,6 +401,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi return(retjson); } } + printf("%s usecache.%d iswatched.%d\n",coinaddr,usecache,LP_address_iswatched(symbol,coinaddr)); if ( LP_address_ismine(symbol,coinaddr) > 0 || LP_address_iswatched(symbol,coinaddr) > 0 ) { if ( strcmp(symbol,"BTC") == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 20d92b4e9..fb0cb5bd8 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -618,13 +618,15 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr cJSON *LP_balances(char *coinaddr) { - struct iguana_info *coin,*tmp; uint64_t balance; cJSON *array,*item,*retjson; + struct iguana_info *coin,*tmp; char address[64]; uint8_t addrtype,rmd160[20]; uint64_t balance; cJSON *array,*item,*retjson; array = cJSON_CreateArray(); HASH_ITER(hh,LP_coins,coin,tmp) { if ( coinaddr != 0 && coinaddr[0] != 0 && strcmp(coinaddr,coin->smartaddr) != 0 ) { - if ( (retjson= LP_address_balance(coin,coinaddr,1)) != 0 ) + bitcoin_addr2rmd160(0,&addrtype,rmd160,coinaddr); + bitcoin_address(address,coin->taddr,coin->pubtype,rmd160,20); + if ( (retjson= LP_address_balance(coin,address,1)) != 0 ) { if ( (balance= jdouble(retjson,"balance")*SATOSHIDEN) > 0 ) { diff --git a/iguana/exchanges/supernet b/iguana/exchanges/supernet index 0f0e991ff..803341f7a 100755 --- a/iguana/exchanges/supernet +++ b/iguana/exchanges/supernet @@ -1,3 +1,4 @@ #!/bin/bash source userpass +# this will only work for watchonly addresses that have been rescanned and with active coins curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balances\",\"address\":\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\"}"