From 6c3487a8eb926f767d0e567663a593a186a5f6a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Jun 2017 08:25:33 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 4 ++-- iguana/exchanges/LP_utxos.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 4be342e24..e1d600b8c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -569,9 +569,9 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port subport = argport + 2; if ( (peer= LP_peerfind((uint32_t)calc_ipbits(ipaddr),argport)) != 0 ) { - if ( (otherpeers= jint(argjson,"numpeers")) > peer->numpeers ) + if ( 0 && (otherpeers= jint(argjson,"numpeers")) > peer->numpeers ) peer->numpeers = otherpeers; - if ( (othernumutxos= jint(argjson,"numutxos")) > peer->numutxos ) + if ( 0 && (othernumutxos= jint(argjson,"numutxos")) > peer->numutxos ) { printf("change.(%s) numutxos.%d -> %d mynumutxos.%d\n",peer->ipaddr,peer->numutxos,othernumutxos,LP_mypeer != 0 ? LP_mypeer->numutxos:0); peer->numutxos = othernumutxos; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 5340de818..1096fd338 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -136,7 +136,7 @@ struct LP_utxoinfo *LP_addutxo(int32_t amclient,struct LP_peerinfo *mypeer,int32 int32_t LP_utxosparse(int32_t amclient,struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr,uint16_t destport,char *retstr,uint32_t now) { - struct LP_peerinfo *peer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; bits256 txid; struct LP_utxoinfo *utxo; + struct LP_peerinfo *peer,*destpeer; uint32_t argipbits; char *argipaddr; uint16_t argport,pushport,subport; cJSON *array,*item; int32_t i,n=0; bits256 txid; struct LP_utxoinfo *utxo; if ( amclient != 0 ) { printf("LP_utxosparse not for clientside\n"); @@ -167,14 +167,15 @@ int32_t LP_utxosparse(int32_t amclient,struct LP_peerinfo *mypeer,int32_t mypubs } } } - /*if ( (destpeer= LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport)) != 0 ) + if ( (destpeer= LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport)) != 0 ) { + destpeer->numutxos = n; if ( destpeer->numutxos < n ) { //destpeer->numutxos = n; //printf("got.(%s) from %s numutxos.%d\n",retstr,destpeer->ipaddr,destpeer->numutxos); } - }*/ + } } free_json(array); }