jl777 8 years ago
parent
commit
8653814762
  1. 4
      basilisk/basilisk_DEX.c
  2. 17
      basilisk/basilisk_MSG.c

4
basilisk/basilisk_DEX.c

@ -479,9 +479,9 @@ int32_t InstantDEX_process_channelget(struct supernet_info *myinfo,void *ptr,int
INT_ARG(InstantDEX,incoming,requestid)
{
cJSON *retjson,*retarray; uint32_t DEX_channel,msgid,now; int32_t retval,width,drift=3; uint8_t data[8192];
cJSON *retjson,*retarray; uint32_t DEX_channel,msgid,now; int32_t retval,width,drift=7; uint8_t data[8192];
now = (uint32_t)time(NULL);
width = (now - myinfo->DEXpoll);
width = (now - myinfo->DEXpoll) + 2*drift;
if ( width < (drift+1) )
width = 2*drift+1;
else if ( width > 64 )

17
basilisk/basilisk_MSG.c

@ -112,32 +112,29 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_
{
keylen = basilisk_messagekey(key,channel,msgid,srchash,desthash);
if ( (item= basilisk_respond_getmessage(myinfo,key,keylen)) != 0 )
jaddi(array,item);
jaddi(array,item), printf("gotmsg0.(%s)\n",jprint(item,0));
if ( origwidth > 0 )
{
if ( bits256_nonz(srchash) != 0 )
{
keylen = basilisk_messagekey(key,channel,msgid,zero,desthash);
int32_t j; for (j=0; j<keylen; j++)
printf("%02x",key[j]);
printf(" <- key\n");
if ( (item= basilisk_respond_getmessage(myinfo,key,keylen)) != 0 )
jaddi(array,item);
jaddi(array,item), printf("gotmsg1.(%s)\n",jprint(item,0));
}
if ( bits256_nonz(desthash) != 0 )
{
keylen = basilisk_messagekey(key,channel,msgid,srchash,zero);
int32_t j; for (j=0; j<keylen; j++)
printf("%02x",key[j]);
printf(" <- key\n");
//int32_t j; for (j=0; j<keylen; j++)
// printf("%02x",key[j]);
//printf(" <- key\n");
if ( (item= basilisk_respond_getmessage(myinfo,key,keylen)) != 0 )
jaddi(array,item);
jaddi(array,item), printf("gotmsg2.(%s)\n",jprint(item,0));
}
if ( bits256_nonz(srchash) != 0 || bits256_nonz(desthash) != 0 )
{
keylen = basilisk_messagekey(key,channel,msgid,zero,zero);
if ( (item= basilisk_respond_getmessage(myinfo,key,keylen)) != 0 )
jaddi(array,item);
jaddi(array,item), printf("gotmsg3.(%s)\n",jprint(item,0));
}
}
msgid--;

Loading…
Cancel
Save