From ab503df182b6a6efe57b32646728b10be0ae07b6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 5 Jun 2017 18:52:08 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_quotes.c | 16 ++++++++++++++-- iguana/exchanges/LP_utxos.c | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_quotes.c b/iguana/exchanges/LP_quotes.c index 04da9278f..8a5ad2bab 100644 --- a/iguana/exchanges/LP_quotes.c +++ b/iguana/exchanges/LP_quotes.c @@ -198,14 +198,16 @@ int32_t LP_arrayfind(cJSON *array,bits256 txid,int32_t vout) cJSON *LP_tradecandidates(struct LP_utxoinfo *myutxo,char *base) { - struct LP_peerinfo *peer,*tmp; struct LP_quoteinfo Q; char *utxostr,coinstr[16]; cJSON *array,*retarray=0,*item; int32_t i,n; double price; + struct LP_peerinfo *peer,*tmp; struct LP_quoteinfo Q; char *utxostr,coinstr[16]; cJSON *array,*retarray=0,*item; int32_t i,n,totaladded,added; double price; if ( (price= LP_price(base,myutxo->coin)) == .0 ) { printf("no LP_price (%s -> %s)\n",base,myutxo->coin); return(0); } + totaladded = 0; HASH_ITER(hh,LP_peerinfos,peer,tmp) { + n = 0; if ( (utxostr= issue_LP_clientgetutxos(peer->ipaddr,peer->port,base,100)) != 0 ) { //printf("%s:%u %s %s\n",peer->ipaddr,peer->port,base,utxostr); @@ -214,6 +216,7 @@ cJSON *LP_tradecandidates(struct LP_utxoinfo *myutxo,char *base) if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { retarray = cJSON_CreateArray(); + added = 0; for (i=0; icoin) == 0) && LP_ismine(utxo) != 0 ) + if ( (coin == 0 || coin[0] == 0 || strcmp(coin,utxo->coin) == 0) )//&& LP_ismine(utxo) != 0 ) { jaddi(utxosjson,LP_utxojson(utxo)); }