diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index a6a05985d..dcab031cc 100755 --- a/iguana/dpow/dpow_network.c +++ b/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->repsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout)); 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]; if ( bp->myind < 0 ) return; + if ( time(NULL) < myinfo->nanoinit+5 ) + return; crc32 = calc_crc32(0,data,datalen); //dp->crcs[firstz] = crc32; 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) { 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 ) { num++; diff --git a/iguana/iguana777.h b/iguana/iguana777.h index fcefb7fb2..6c2640990 100755 --- a/iguana/iguana777.h +++ b/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 *decryptstr; 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; struct basilisk_info basilisks; struct exchange_info *tradingexchanges[SUPERNET_MAXEXCHANGES]; int32_t numexchanges;