From aeef89276cab9ea407d7bb39426f3700c8f07191 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Sep 2016 10:00:54 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 4 ++-- basilisk/basilisk_DEX.c | 6 +++--- basilisk/basilisk_MSG.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 43c30a9df..09a0c3376 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -860,8 +860,8 @@ void basilisks_loop(void *arg) } portable_mutex_unlock(&myinfo->messagemutex); if ( RELAYID >= 0 ) - usleep(100000); - else sleep(1); + usleep(10000); + else usleep(100000); } } diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index d09a550b5..5245c546d 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -517,9 +517,9 @@ INT_ARG(InstantDEX,incoming,requestid) cJSON *retjson,*retarray; uint32_t DEX_channel,msgid,now; int32_t retval,width,drift=3; uint8_t data[8192]; now = (uint32_t)time(NULL); width = (now - myinfo->DEXpoll); - //if ( width < (drift+1) ) - // width = 2*drift+1; - //else if ( width > 64 ) + if ( width < (drift+1) ) + width = 2*drift+1; + else if ( width > 64 ) width = 64; myinfo->DEXpoll = now; myinfo->DEXactive = now + INSTANTDEX_LOCKTIME; diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index dd9151b61..d0e334d10 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -226,7 +226,7 @@ int32_t basilisk_message_returned(uint8_t *key,uint8_t *data,int32_t maxlen,cJSO for (i=0; i 0 ) + if ( (keystr= jstr(item,"key")) != 0 && is_hexstr(keystr,0) == BASILISK_KEYSIZE*2 && (hexstr= jstr(item,"data")) != 0 && (datalen= is_hexstr(hexstr,0)) > 0 ) { decode_hex(key,BASILISK_KEYSIZE,keystr); datalen >>= 1; @@ -238,7 +238,7 @@ int32_t basilisk_message_returned(uint8_t *key,uint8_t *data,int32_t maxlen,cJSO } else printf("datalen.%d < maxlen.%d\n",datalen,maxlen); } } - } // else printf("no hexstr.%p or datalen.%d (%s)\n",hexstr,datalen,jprint(json,0)); + } //else printf("no hexstr.%p or datalen.%d (%s)\n",hexstr,datalen,jprint(json,0)); return(retval); } @@ -251,7 +251,7 @@ cJSON *basilisk_channelget(struct supernet_info *myinfo,bits256 hash,uint32_t ch msgid = (uint32_t)time(NULL); jaddnum(valsobj,"msgid",msgid); jaddnum(valsobj,"width",width); - jaddnum(valsobj,"timeout",1000); + jaddnum(valsobj,"timeout",1500); jaddnum(valsobj,"fanout",(int32_t)sqrt(NUMRELAYS)+1); jaddnum(valsobj,"minresults",1); if ( (retstr= basilisk_getmessage(myinfo,0,0,0,hash,valsobj,0)) != 0 ) @@ -290,7 +290,7 @@ int32_t basilisk_process_retarray(struct supernet_info *myinfo,void *ptr,int32_t if ( (*process_func)(myinfo,ptr,internal_func,channel,msgid,data,datalen,expiration,duration) < 0 ) errs++; free(retstr); - } + } // else printf("duplicate.%d skipped\n",datalen); } } //printf("n.%d maxlen.%d\n",n,maxlen);