Browse Source

test

etomic
jl777 8 years ago
parent
commit
b24f0bfb42
  1. 5
      iguana/dpow/dpow_network.c
  2. 2
      iguana/iguana777.h

5
iguana/dpow/dpow_network.c

@ -319,6 +319,7 @@ void dpow_nanomsginit(struct supernet_info *myinfo,char *ipaddr)
nn_setsockopt(myinfo->dexsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(myinfo->dexsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
nn_setsockopt(myinfo->repsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); nn_setsockopt(myinfo->repsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
printf("DEXINIT dex.%d rep.%d\n",myinfo->dexsock,myinfo->repsock); printf("DEXINIT dex.%d rep.%d\n",myinfo->dexsock,myinfo->repsock);
myinfo->nanoinit = (uint32_t)time(NULL);
} }
} }
} }
@ -640,6 +641,8 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_blo
struct dpow_nanomsghdr *np; int32_t i,size,extralen=0,sentbytes = 0; uint32_t crc32; uint8_t extras[10000]; struct dpow_nanomsghdr *np; int32_t i,size,extralen=0,sentbytes = 0; uint32_t crc32; uint8_t extras[10000];
if ( bp->myind < 0 ) if ( bp->myind < 0 )
return; return;
if ( time(NULL) < myinfo->nanoinit+5 )
return;
crc32 = calc_crc32(0,data,datalen); crc32 = calc_crc32(0,data,datalen);
//dp->crcs[firstz] = crc32; //dp->crcs[firstz] = crc32;
size = (int32_t)(sizeof(*np) + datalen); size = (int32_t)(sizeof(*np) + datalen);
@ -729,6 +732,8 @@ void dpow_ipbitsadd(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t *
void dpow_nanomsg_update(struct supernet_info *myinfo) void dpow_nanomsg_update(struct supernet_info *myinfo)
{ {
int32_t i,n=0,num=0,size,firstz = -1; uint32_t crc32,r,m; struct dpow_nanomsghdr *np=0; struct dpow_info *dp; struct dpow_block *bp; struct dex_nanomsghdr *dexp = 0; int32_t i,n=0,num=0,size,firstz = -1; uint32_t crc32,r,m; struct dpow_nanomsghdr *np=0; struct dpow_info *dp; struct dpow_block *bp; struct dex_nanomsghdr *dexp = 0;
if ( time(NULL) < myinfo->nanoinit+5 )
return;
while ( (size= nn_recv(myinfo->dpowsock,&np,NN_MSG,0)) >= 0 ) while ( (size= nn_recv(myinfo->dpowsock,&np,NN_MSG,0)) >= 0 )
{ {
num++; num++;

2
iguana/iguana777.h

@ -89,7 +89,7 @@ struct supernet_info
char ipaddr[64],NXTAPIURL[512],secret[4096],password[4096],rpcsymbol[64],handle[1024],permanentfile[1024]; char ipaddr[64],NXTAPIURL[512],secret[4096],password[4096],rpcsymbol[64],handle[1024],permanentfile[1024];
char *decryptstr; char *decryptstr;
int32_t maxdelay,IAMRELAY,IAMNOTARY,IAMLP,publicRPC,basilisk_busy,genesisresults,remoteorigin; int32_t maxdelay,IAMRELAY,IAMNOTARY,IAMLP,publicRPC,basilisk_busy,genesisresults,remoteorigin;
uint32_t expiration,dirty,DEXactive,DEXpoll,totalcoins,dexcrcs[1024]; uint32_t expiration,dirty,DEXactive,DEXpoll,totalcoins,nanoinit,dexcrcs[1024];
uint16_t argport,rpcport; uint16_t argport,rpcport;
struct basilisk_info basilisks; struct basilisk_info basilisks;
struct exchange_info *tradingexchanges[SUPERNET_MAXEXCHANGES]; int32_t numexchanges; struct exchange_info *tradingexchanges[SUPERNET_MAXEXCHANGES]; int32_t numexchanges;

Loading…
Cancel
Save