diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 103950e88..71eb62250 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -363,7 +363,7 @@ dividends(coin, height, )\n\ coinaddr = jstr(argjson,"coinaddr"); if ( coin != 0 && coinaddr != 0 ) { - //char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); + char str[65]; printf("uitem %s %s %s/v%d %.8f ht.%d\n",coin,coinaddr,bits256_str(str,txid),vout,dstr(value),height); LP_address_utxoadd(LP_coinfind(coin),coinaddr,txid,vout,value,height,-1); } return(clonestr("{\"result\":\"success\"}")); @@ -416,6 +416,47 @@ dividends(coin, height, )\n\ } else if ( strcmp(method,"checktxid") == 0 ) retstr = LP_spentcheck(argjson); + else if ( strcmp(method,"addr_unspents") == 0 ) + { + if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) + { + char *coinaddr; cJSON *array,*item,*req; int32_t i,n,vout,height; bits256 zero,txid; uint64_t value; + if ( (coinaddr= jstr(argjson,"address")) != 0 ) + { + if ( coinaddr[0] != 0 ) + { + if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) + { + printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + if ( (array= LP_address_utxos(ptr,coinaddr,1)) != 0 ) + { + memset(zero.bytes,0,sizeof(zero)); + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; icoinaddr); if ( relcoin->electrum == 0 ) LP_listunspent_issue(rel,bids[i]->coinaddr); + LP_listunspent_query(rel,bids[i]->coinaddr); n++; } free(bids[i]); @@ -794,6 +795,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) LP_address(basecoin,asks[i]->coinaddr); if ( basecoin->electrum == 0 ) LP_listunspent_issue(base,asks[i]->coinaddr); + LP_listunspent_query(base,asks[i]->coinaddr); n++; } free(asks[i]);