diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ade4ba249..2a1880b42 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -239,7 +239,15 @@ forwardhex(pubkey,hex)\n\ else if ( strcmp(method,"forwardhex") == 0 ) retstr = LP_forwardhex(pubsock,jbits256(argjson,"pubkey"),jstr(argjson,"hex")); else if ( strcmp(method,"psock") == 0 ) + { + if ( myipaddr == 0 || myipaddr[0] == 0 || strcmp(myipaddr,"127.0.0.1") == 0 ) + { + if ( LP_mypeer != 0 ) + myipaddr = LP_mypeer->ipaddr; + else printf("LP_psock dont have actual ipaddr?\n"); + } return(LP_psock(myipaddr,jint(argjson,"ispaired"))); + } else if ( strcmp(method,"notify") == 0 ) retstr = clonestr("{\"result\":\"success\",\"notify\":\"received\"}"); } diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 751696ceb..cd9155e5c 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -132,6 +132,7 @@ uint16_t LP_psock_get(char *connectaddr,char *publicaddr,int32_t ispaired) { if ( (retstr= issue_LP_psock(peer->ipaddr,peer->port,ispaired)) != 0 ) { + printf("got.(%s)\n",retstr); if ( (retjson= cJSON_Parse(retstr)) != 0 ) { if ( (addr= jstr(retjson,"publicaddr")) != 0 )