Browse Source

Merge pull request #444 from jl777/spvdex

Spvdex
etomic
jl777 7 years ago
committed by GitHub
parent
commit
7534772810
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 2
      iguana/exchanges/LP_socket.c
  4. 6
      iguana/exchanges/stats.c

5
iguana/exchanges/LP_commands.c

@ -375,10 +375,7 @@ bot_resume(botid)\n\
if ( (ptr= LP_coinsearch(coin)) != 0 ) if ( (ptr= LP_coinsearch(coin)) != 0 )
{ {
ptr->inactive = 0; ptr->inactive = 0;
retstr = jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1); return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1));
if ( ptr->electrum != 0 && (retjson= electrum_address_listunspent(ptr->symbol,ptr->electrum,&retjson,ptr->smartaddr,2)) != 0 )
free_json(retjson);
return(retstr);
} else return(clonestr("{\"error\":\"cant find coind\"}")); } else return(clonestr("{\"error\":\"cant find coind\"}"));
} }
else if ( strcmp(method,"sendrawtransaction") == 0 ) else if ( strcmp(method,"sendrawtransaction") == 0 )

2
iguana/exchanges/LP_nativeDEX.c

@ -1179,7 +1179,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
usleep(1000); usleep(1000);
else if ( IAMLP == 0 ) else if ( IAMLP == 0 )
usleep(1000); usleep(1000);
/*if ( (rand() % 1000) == 0 ) /*if ( (rand() % 10000) == 0 )
{ {
int32_t sock = LP_bindsock; int32_t sock = LP_bindsock;
printf("bindsock reset test\n"); printf("bindsock reset test\n");

2
iguana/exchanges/LP_socket.c

@ -1055,7 +1055,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port)
} }
else else
{ {
printf("launched electrum.(%s:%u)\n",ep->ipaddr,ep->port); printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port);
jaddstr(retjson,"result","success"); jaddstr(retjson,"result","success");
ep->prev = coin->electrum; ep->prev = coin->electrum;
coin->electrum = ep; coin->electrum = ep;

6
iguana/exchanges/stats.c

@ -741,9 +741,10 @@ void LP_rpc_processreq(void *_ptr)
extern int32_t IAMLP; extern int32_t IAMLP;
int32_t LP_bindsock = -1; int32_t LP_bindsock = -1;
void stats_rpcloop(void *args) void stats_rpcloop(void *args)
{ {
//static uint32_t counter; static uint32_t counter;
uint16_t port; int32_t retval,sock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp; uint16_t port; int32_t retval,sock; socklen_t clilen; struct sockaddr_in cli_addr; uint32_t ipbits,localhostbits; struct rpcrequest_info *req,*req2,*rtmp;
if ( (port= *(uint16_t *)args) == 0 ) if ( (port= *(uint16_t *)args) == 0 )
port = 7779; port = 7779;
@ -756,9 +757,10 @@ void stats_rpcloop(void *args)
{ {
while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 )
usleep(10000); usleep(10000);
//if ( counter++ < 1 ) if ( counter++ < 1 )
printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock); printf(">>>>>>>>>> DEX stats 127.0.0.1:%d bind sock.%d DEX stats API enabled <<<<<<<<<\n",port,LP_bindsock);
} }
//printf("after LP_bindsock.%d\n",LP_bindsock);
clilen = sizeof(cli_addr); clilen = sizeof(cli_addr);
sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen); sock = accept(LP_bindsock,(struct sockaddr *)&cli_addr,&clilen);
if ( sock < 0 ) if ( sock < 0 )

Loading…
Cancel
Save