jl777 8 years ago
parent
commit
e7339115e5
  1. 2
      basilisk/basilisk.c
  2. 2
      basilisk/basilisk_DEX.c
  3. 3
      basilisk/basilisk_MSG.c
  4. 5
      basilisk/basilisk_tradebot.c

2
basilisk/basilisk.c

@ -792,7 +792,7 @@ void basilisk_p2p(void *_myinfo,void *_addr,char *senderip,uint8_t *data,int32_t
len += iguana_rwnum(0,data,sizeof(basilisktag),&basilisktag);
//int32_t i; for (i=0; i<datalen-len; i++)
// printf("%02x",data[len+i]);
if ( myinfo->NOTARY.RELAYID >= 0 )
if ( 0 && myinfo->NOTARY.RELAYID >= 0 )
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,datalen,type,senderip!=0?senderip:"?",basilisktag);
basilisk_msgprocess(myinfo,_addr,ipbits,type,basilisktag,&data[len],datalen - len);
}

2
basilisk/basilisk_DEX.c

@ -479,7 +479,7 @@ 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=7; uint8_t data[8192];
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) + 2*drift;
if ( width < (drift+1) )

3
basilisk/basilisk_MSG.c

@ -107,7 +107,7 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_
width = 3600;
else if ( width < 1 )
width = 1;
printf("iterate_MSG width.%d channel.%d msgid.%d src.%llx -> %llx\n",origwidth,channel,msgid,(long long)srchash.txid,(long long)desthash.txid);
//printf("iterate_MSG width.%d channel.%d msgid.%d src.%llx -> %llx\n",origwidth,channel,msgid,(long long)srchash.txid,(long long)desthash.txid);
for (i=0; i<width; i++)
{
keylen = basilisk_messagekey(key,channel,msgid,srchash,desthash);
@ -144,6 +144,7 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_
retjson = cJSON_CreateObject();
jaddstr(retjson,"result","success");
jadd(retjson,"messages",array);
printf("MESSAGES.(%s)\n",jprint(array,0));
return(jprint(retjson,1));
} else return(clonestr("{\"error\":\"no messages\"}"));
}

5
basilisk/basilisk_tradebot.c

@ -230,7 +230,8 @@ double basilisk_process_results(struct supernet_info *myinfo,struct basilisk_req
{
cJSON *array,*item; int32_t i,n,m,nonz; struct basilisk_request tmpR,R,refR,list[BASILISK_MAXRELAYS]; double metric=0.;
memset(&refR,0,sizeof(refR));
if ( (array= jarray(&n,retjson,"result")) != 0 )
//printf("process.(%s)\n",jprint(retjson,0));
if ( (array= jarray(&n,retjson,"messages")) != 0 )
{
for (i=nonz=m=0; i<n; i++)
{
@ -258,7 +259,7 @@ double basilisk_process_results(struct supernet_info *myinfo,struct basilisk_req
basilisk_parsejson(&list[m++],item);
}
}
printf("process_results n.%d m.%d nonz.%d\n",n,m,nonz);
//printf("process_results n.%d m.%d nonz.%d\n",n,m,nonz);
if ( m > 0 && m < sizeof(list)/sizeof(*list) )
if ( (metric= basilisk_request_listprocess(myinfo,&tmpR,list,m)) > hwm )
*issueR = tmpR, hwm = metric;

Loading…
Cancel
Save