diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 250fe68b2..bd38ebd22 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -87,6 +87,7 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char strcpy(peer->ipaddr,ipaddr); //peer->profitmargin = profitmargin; peer->ipbits = ipbits; + peer->isLP = isLP; peer->port = port; peer->ip_port = ((uint64_t)port << 32) | ipbits; if ( pushport != 0 && subport != 0 && (pushsock= nn_socket(AF_SP,NN_PUSH)) >= 0 ) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index c1032b823..c8552a02b 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -571,12 +571,9 @@ void LP_notify_pubkeys(void *ctx,int32_t pubsock) LP_pubkey_sigadd(reqjson,timestamp,G.LP_privkey,G.LP_mypub25519,G.LP_myrmd160,G.LP_pubsecp); if ( IAMLP != 0 ) { - if ( (rand() % 2) == 0 ) - LP_randpeer(LPipaddr); - else strcpy(LPipaddr,LP_myipaddr); - if ( LPipaddr[0] == 0 ) - strcpy(LPipaddr,LP_myipaddr); - jaddstr(reqjson,"isLP",LPipaddr); + if ( LP_randpeer(LPipaddr) != 0 ) + jaddstr(reqjson,"isLP",LPipaddr); + else printf("no LPipaddr\n"); } jaddnum(reqjson,"session",G.LP_sessionid); LP_reserved_msg(0,"","",zero,jprint(reqjson,1));