Browse Source

Merge pull request #263 from jl777/dev

Dev
win-cross
jl777 8 years ago
committed by GitHub
parent
commit
1f9a65f372
  1. 14
      iguana/dpow/dpow_network.c
  2. 2
      iguana/iguana777.h

14
iguana/dpow/dpow_network.c

@ -82,8 +82,8 @@ void dex_init(struct supernet_info *myinfo)
while ( 1 )
{
j = (rand() % (sizeof(seeds)/sizeof(*seeds)));
if ( i == 0 )
j = 0;
if ( i < 2 )
j = i;
if ( ((1 << j) & mask) == 0 )
break;
}
@ -285,11 +285,11 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *key,int32
{
if ( reqsock >= 0 )
{
timeout = 100;
timeout = 1000;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout));
timeout = 3000;
timeout = 5000;
nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout));
timeout = 3000;
timeout = 10000;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
for (i=0; i<sizeof(myinfo->dexseed_ipaddrs)/sizeof(*myinfo->dexseed_ipaddrs); i++)
if ( nn_connect(reqsock,nanomsg_tcpname(0,str,myinfo->dexseed_ipaddrs[i],REP_SOCK)) < 0 )
@ -318,9 +318,9 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *key,int32
nn_setsockopt(subsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
nn_setsockopt(subsock,NN_SUB,NN_SUB_SUBSCRIBE,"",0);
printf("CLIENT sockets req.%d sub.%d\n",reqsock,subsock);
timeout = 3000;
timeout = 5000;
nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout));
timeout = 3000;
timeout = 10000;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
}
}

2
iguana/iguana777.h

@ -133,7 +133,7 @@ struct supernet_info
struct liquidity_info linfos[512]; cJSON *liquidity_currencies; struct pending_trade *trades; portable_mutex_t pending_mutex;
struct komodo_notaries NOTARY;
char seedipaddr[64]; uint32_t dpowipbits[128]; int32_t numdpowipbits; portable_mutex_t notarymutex,dpowmutex;
char dexseed_ipaddrs[8][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex;
char dexseed_ipaddrs[2][64]; uint32_t dexipbits[128]; int32_t numdexipbits; portable_mutex_t dexmutex;
// compatibility
bits256 pangea_category,instantdex_category;
uint8_t logs[256],exps[510];

Loading…
Cancel
Save