Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
67ef640147
  1. 12
      basilisk/basilisk.c
  2. 1
      basilisk/basilisk_DEX.c

12
basilisk/basilisk.c

@ -794,9 +794,9 @@ double basilisk_request_listprocess(struct supernet_info *myinfo,struct basilisk
return(metric); return(metric);
} }
double basilisk_process_results(struct supernet_info *myinfo,cJSON *retjson,double hwm) double basilisk_process_results(struct supernet_info *myinfo,struct basilisk_request *issueR,cJSON *retjson,double hwm)
{ {
cJSON *array,*item; int32_t i,n,m; struct basilisk_request tmpR,R,issueR,refR,list[BASILISK_MAXRELAYS*10]; double metric=0.; cJSON *array,*item; int32_t i,n,m; struct basilisk_request tmpR,R,refR,list[BASILISK_MAXRELAYS*10]; double metric=0.;
if ( (array= jarray(&n,retjson,"result")) != 0 ) if ( (array= jarray(&n,retjson,"result")) != 0 )
{ {
for (i=m=0; i<n; i++) for (i=m=0; i<n; i++)
@ -810,7 +810,7 @@ double basilisk_process_results(struct supernet_info *myinfo,cJSON *retjson,doub
else else
{ {
if ( (metric= basilisk_request_listprocess(myinfo,&tmpR,list,m)) > hwm ) if ( (metric= basilisk_request_listprocess(myinfo,&tmpR,list,m)) > hwm )
issueR = tmpR, hwm = metric; *issueR = tmpR, hwm = metric;
m = 0; m = 0;
} }
} }
@ -819,7 +819,7 @@ double basilisk_process_results(struct supernet_info *myinfo,cJSON *retjson,doub
} }
if ( m > 0 && m < sizeof(list)/sizeof(*list) ) if ( m > 0 && m < sizeof(list)/sizeof(*list) )
if ( (metric= basilisk_request_listprocess(myinfo,&tmpR,list,m)) > hwm ) if ( (metric= basilisk_request_listprocess(myinfo,&tmpR,list,m)) > hwm )
issueR = tmpR, hwm = metric; *issueR = tmpR, hwm = metric;
} }
return(hwm); return(hwm);
} }
@ -843,8 +843,8 @@ void basilisk_requests_poll(struct supernet_info *myinfo)
{ {
n = cJSON_GetArraySize(outerarray); n = cJSON_GetArraySize(outerarray);
for (i=0; i<n; i++) for (i=0; i<n; i++)
hwm = basilisk_process_results(myinfo,jitem(outerarray,i),hwm); hwm = basilisk_process_results(myinfo,&issueR,jitem(outerarray,i),hwm);
} else hwm = basilisk_process_results(myinfo,outerarray,hwm); } else hwm = basilisk_process_results(myinfo,&issueR,outerarray,hwm);
free_json(outerarray); free_json(outerarray);
} }
free(retstr); free(retstr);

1
basilisk/basilisk_DEX.c

@ -435,6 +435,7 @@ char *basilisk_respond_accept(struct supernet_info *myinfo,uint32_t requestid,ui
rp = &requests[i]; rp = &requests[i];
if ( rp->requestid == requestid && rp->quoteid == quoteid ) if ( rp->requestid == requestid && rp->quoteid == quoteid )
{ {
printf("start from accept\n");
retstr = basilisk_start(myinfo,rp,1); retstr = basilisk_start(myinfo,rp,1);
break; break;
} }

Loading…
Cancel
Save