|
|
@ -264,7 +264,7 @@ int32_t LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pu |
|
|
|
return(n); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock) |
|
|
|
int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int32_t sock,char *remoteaddr) |
|
|
|
{ |
|
|
|
int32_t recvlen=1,nonz = 0; cJSON *argjson; void *ptr; char *retstr,*str; struct nn_pollfd pfd; |
|
|
|
if ( sock >= 0 ) |
|
|
@ -288,7 +288,9 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int |
|
|
|
Broadcaststr = 0; |
|
|
|
if ( (argjson= cJSON_Parse(str)) != 0 ) |
|
|
|
{ |
|
|
|
LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0); |
|
|
|
if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) |
|
|
|
free(retstr); |
|
|
|
//LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0);
|
|
|
|
free_json(argjson); |
|
|
|
} |
|
|
|
free(str); |
|
|
@ -317,7 +319,7 @@ void command_rpcloop(void *myipaddr) |
|
|
|
else continue; |
|
|
|
} |
|
|
|
//printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock);
|
|
|
|
nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock); |
|
|
|
nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr); |
|
|
|
} |
|
|
|
/*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
|
|
|
|
{ |
|
|
@ -327,7 +329,7 @@ void command_rpcloop(void *myipaddr) |
|
|
|
nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.); |
|
|
|
}*/ |
|
|
|
if ( LP_mypullsock >= 0 ) |
|
|
|
nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock); |
|
|
|
nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1"); |
|
|
|
//if ( LP_mybussock >= 0 )
|
|
|
|
// nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock);
|
|
|
|
if ( nonz == 0 ) |
|
|
|