From d24769d56b03d134cb814b8fef9965fbf4f47f8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Jun 2017 09:15:50 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_utxos.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5f897a525..68b9f3987 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -224,10 +224,13 @@ void LP_utxosquery(int32_t amclient,struct LP_peerinfo *mypeer,int32_t mypubsock char *LP_inventory(char *symbol) { - struct LP_utxoinfo *utxo,*tmp; cJSON *array = cJSON_CreateArray(); + struct LP_utxoinfo *utxo,*tmp; char *myipaddr; cJSON *array = cJSON_CreateArray(); + if ( LP_mypeer != 0 ) + myipaddr = LP_mypeer->ipaddr; + else myipaddr = "127.0.0.1"; HASH_ITER(hh,LP_utxoinfos,utxo,tmp) { - if ( strcmp(symbol,utxo->coin) == 0 && (IAMCLIENT != 0 || strcmp(utxo->ipaddr,"127.0.0.1") != 0) ) + if ( strcmp(symbol,utxo->coin) == 0 && (IAMCLIENT != 0 || strcmp(utxo->ipaddr,myipaddr) != 0) ) jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo)); } return(jprint(array,1));