diff --git a/iguana/exchanges/LP_forwarding.c b/iguana/exchanges/LP_forwarding.c index 7d629226f..f7096f3fc 100644 --- a/iguana/exchanges/LP_forwarding.c +++ b/iguana/exchanges/LP_forwarding.c @@ -120,6 +120,7 @@ char *LP_register(bits256 pubkey,char *ipaddr,uint16_t port) { nn_close(ptr->pushsock); printf("recreate pushsock for %s\n",pushaddr); + strcpy(ptr->pushaddr,pushaddr); if ( (ptr->pushsock= LP_pushsock_create(ptr,pushaddr)) < 0 ) return(clonestr("{\"error\":\"couldnt recreate pushsock\",\"registered\":0}")); } else printf("no need to create identical endpoint\n"); diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 2840d3a95..163fe57f7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -114,7 +114,7 @@ void LP_psockloop(void *_ptr) if ( (sentbytes= nn_send(sendsock,buf,size,0)) > 0 ) { ptr->lasttime = now; - printf("PSOCKS (%d %d %d) -> %d/%d bytes\n",ptr->recvsock,ptr->sendsock,sendsock,size,sentbytes); + printf("PSOCKS (%d %d %d) -> %d/%d bytes %s\n",ptr->recvsock,ptr->sendsock,sendsock,size,sentbytes,ptr->sendaddr); } else printf("send error to %s\n",ptr->sendaddr); if ( buf != 0 ) { @@ -156,6 +156,7 @@ void LP_psockloop(void *_ptr) { ptr->lasttime = now; sendsock = ptr->sendsock; + printf("[%s]\n",(char *)buf); break; } } @@ -208,14 +209,14 @@ void LP_psockloop(void *_ptr) if ( i < Numpsocks ) { ptr = &PSOCKS[i]; - if ( (size= nn_recv(ptr->recvsock,&buf,NN_MSG,0)) > 0 ) + /*if ( (size= nn_recv(ptr->recvsock,&buf,NN_MSG,0)) > 0 ) { printf("got %d bytes for %s\n",size,ptr->sendaddr); ptr->lasttime = now; sendsock = ptr->sendsock; break; } - else if ( now > ptr->lasttime+PSOCK_IDLETIMEOUT ) + else*/ if ( now > ptr->lasttime+PSOCK_IDLETIMEOUT ) { printf("PSOCKS[%d] of %d (%u %u) lag.%d IDLETIMEOUT\n",i,Numpsocks,ptr->recvport,ptr->sendport,now - ptr->lasttime); if ( ptr->recvsock >= 0 )