From 0ce78e50ae279d3d9a84066967354fe7ed21164c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 23 May 2017 21:09:31 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_unspents.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_unspents.c b/iguana/exchanges/LP_unspents.c index 469dc5e37..99628c42d 100644 --- a/iguana/exchanges/LP_unspents.c +++ b/iguana/exchanges/LP_unspents.c @@ -13,7 +13,7 @@ char *default_LPnodes[] = { "5.9.253.195", "5.9.253.196", "5.9.253.197", "5.9.25 struct LP_peerinfo { double profitmargin; - uint32_t ipbits,gotintro,sentintro,errortime,errors; + uint32_t ipbits,gotintro,sentintro,errortime,errors,numpeers; char ipaddr[64],notify_ipaddr[64]; uint16_t port,notify_port; } LP_peerinfos[1024]; @@ -64,6 +64,8 @@ void LP_notify(struct LP_peerinfo *peer,char *ipaddr,uint16_t port,char *retstr) { if ( (n= cJSON_GetArraySize(array)) > 0 ) { + if ( n != peer->numpeers ) + peer->numpeers = n; for (i=0; inumpeers != LP_numpeers && (peer->notify_ipaddr[0] == 0 || peer->notify_port == 0) ) + { + strcpy(peer->notify_ipaddr,LP_peerinfos[0].ipaddr); + peer->notify_port = LP_peerinfos[0].port; + printf("LP_numpeers.%d != (%s).%d\n",LP_numpeers,peer->ipaddr,peer->numpeers); + } if ( peer->notify_ipaddr[0] != 0 && peer->notify_port != 0 ) { strcpy(tmp,peer->notify_ipaddr);