Browse Source

Test

etomic
jl777 8 years ago
parent
commit
9906517f47
  1. 6
      iguana/exchanges/LP_unspents.c
  2. 4
      iguana/exchanges/mm.c

6
iguana/exchanges/LP_unspents.c

@ -279,7 +279,7 @@ void LPinit(uint16_t port,double profitmargin)
if ( i > 0 )
{
peer = &LP_peerinfos[i];
if ( (retstr= issue_LP_getpeers(peer->ipaddr,peer->port)) != 0 )
if ( (retstr= issue_LP_getpeers(peer->ipaddr,peer->port,LP_peerinfos[0].ipaddr,LP_peerinfos[0].port,LP_peerinfos[0].profitmargin)) != 0 )
{
LP_notify(&LP_peerinfos[0],peer->ipaddr,peer->port,retstr);
//free(retstr);
@ -302,8 +302,8 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port)
if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (profitmargin= jdouble(argjson,"profit")) != 0. )
retstr = LP_addpeer(ipaddr,argport,(uint32_t)time(NULL),0,profitmargin);
}
else if ( strcmp(method,"getpeers") == 0 )
retstr = LP_peers();
else if ( strcmp(method,"getpeers") == 0 && (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (profitmargin= jdouble(argjson,"profit")) != 0. )
retstr = LP_addpeer(ipaddr,argport,(uint32_t)time(NULL),0,profitmargin);
else if ( strcmp(method,"getutxos") == 0 && (coin= jstr(argjson,"coin")) != 0 && (dest= jstr(argjson,"dest")) != 0 )
{
//retstr = LP_getutxos(coin,dest);

4
iguana/exchanges/mm.c

@ -167,10 +167,10 @@ char *issue_LP_intro(char *destip,uint16_t destport,char *ipaddr,uint16_t port,d
return(issue_curl(url));
}
char *issue_LP_getpeers(char *destip,uint16_t destport)
char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t port,double profitmargin)
{
char url[512];
sprintf(url,"http://%s:%u/api/stats/getpeers",destip,destport);
sprintf(url,"http://%s:%u/api/stats/getpeers?ipaddr=%s&port=%u&profit=%.6f",destip,destport,ipaddr,port,profitmargin);
return(issue_curl(url));
}

Loading…
Cancel
Save