From fb4179c174b8d4bec9081e3a48d704ba08c8fab0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jul 2017 20:24:54 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_peers.c | 4 +++- iguana/exchanges/LP_rpc.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index f952989be..cde113f83 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -71,7 +71,9 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char { printf("LPaddpeer %s\n",ipaddr); peer = calloc(1,sizeof(*peer)); - peer->sessionid = sessionid; + if ( strcmp(peer->ipaddr,LP_myipaddr) == 0 ) + peer->sessionid = LP_sessionid; + else peer->sessionid = sessionid; peer->pushsock = peer->subsock = pushsock = subsock = -1; strcpy(peer->ipaddr,ipaddr); if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 1addc118f..5006f536a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -50,9 +50,11 @@ char *LP_isitme(char *destip,uint16_t destport) char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) { - char url[512]; + char url[512],*retstr; sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); - return(LP_issue_curl("getpeers",destip,port,url)); + retstr = LP_issue_curl("getpeers",destip,port,url); + printf("getpeers.(%s)\n",retstr); + return(retstr); } char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos)