Browse Source

Test

etomic
jl777 7 years ago
parent
commit
9aa65e5381
  1. 2
      iguana/exchanges/LP_rpc.c
  2. 6
      iguana/exchanges/LP_utxo.c
  3. 1
      iguana/exchanges/supernet

2
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 )

6
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 )
{

1
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\"}"

Loading…
Cancel
Save