Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
aeef89276c
  1. 4
      basilisk/basilisk.c
  2. 6
      basilisk/basilisk_DEX.c
  3. 8
      basilisk/basilisk_MSG.c

4
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);
}
}

6
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;

8
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<n; i++)
{
item = jitem(msgobj,i);
if ( (keystr= jstr(item,"key")) != 0 && is_hexstr(keystr,0) == BASILISK_KEYSIZE && (hexstr= jstr(item,"data")) != 0 && (datalen= is_hexstr(hexstr,0)) > 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);

Loading…
Cancel
Save