Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
146fce0666
  1. 10
      basilisk/basilisk.c
  2. 2
      basilisk/basilisk_bitcoin.c

10
basilisk/basilisk.c

@ -309,11 +309,11 @@ char *basilisk_waitresponse(struct supernet_info *myinfo,char *CMD,char *symbol,
if ( (retstr= Lptr->retstr) == 0 )
retstr = clonestr("{\"result\":\"null return from local basilisk_issuecmd\"}");
ptr = basilisk_itemcreate(myinfo,CMD,symbol,Lptr->basilisktag,Lptr->numrequired,Lptr->vals,OS_milliseconds() - Lptr->expiration,Lptr->metricfunc);
queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
//queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
}
else
{
queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
//queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
while ( OS_milliseconds() < ptr->expiration )
{
//if ( (retstr= basilisk_iscomplete(ptr)) != 0 )
@ -345,6 +345,7 @@ struct basilisk_item *basilisk_issueremote(struct supernet_info *myinfo,int32_t
{
data = basilisk_jsondata(sizeof(struct iguana_msghdr),&allocptr,space,sizeof(space),&datalen,symbol,valsobj,basilisktag);
*numsentp = ptr->numsent = basilisk_sendcmd(myinfo,0,CMD,&ptr->basilisktag,encryptflag,delaymillis,data,datalen,1,ptr->nBits);
queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
if ( allocptr != 0 )
free(allocptr);
}
@ -386,6 +387,7 @@ char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,bits256 ha
ptr->vals = jduplicate(valsobj);
strcpy(ptr->symbol,"BTCD");
strcpy(ptr->CMD,CMD);
queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
return(basilisk_waitresponse(myinfo,CMD,"BTCD",0,&Lptr,ptr));
}
else if ( ptr->numsent > 0 )
@ -533,7 +535,10 @@ char *basilisk_standardcmd(struct supernet_info *myinfo,char *CMD,char *activeco
if ( (coin= iguana_coinfind(activecoin)) != 0 )
{
if ( (ptr= basilisk_issuecmd(&Lptr,func,metric,myinfo,remoteaddr,basilisktag,activecoin,timeoutmillis,vals)) != 0 )
{
queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
return(basilisk_waitresponse(myinfo,CMD,coin->symbol,remoteaddr,&Lptr,ptr));
}
else return(clonestr("{\"error\":\"null return from basilisk_issuecmd\"}"));
} else return(clonestr("{\"error\":\"couldnt get coin\"}"));
} else return(retstr);
@ -619,6 +624,7 @@ INT_ARRAY_STRING(basilisk,rawtx,basilisktag,vals,activecoin)
ptr->numrequired = 1;
ptr->uniqueflag = 1;
ptr->metricdir = -1;
queue_enqueue("submitQ",&myinfo->basilisks.submitQ,&ptr->DL,0);
return(basilisk_waitresponse(myinfo,"RAW",coin->symbol,remoteaddr,&Lptr,ptr));
} else return(clonestr("{\"error\":\"error issuing basilisk rawtx\"}"));
} else return(retstr);

2
basilisk/basilisk_bitcoin.c

@ -364,7 +364,7 @@ void *basilisk_bitcoinvalue(struct basilisk_item *Lptr,struct supernet_info *myi
}
}
}
printf("bitcoinvalue issue remote\n");
printf("bitcoinvalue issue remote tag.%u\n",basilisktag);
return(basilisk_issueremote(myinfo,&numsent,"VAL",coin->symbol,valsobj,juint(valsobj,"fanout"),juint(valsobj,"minresults"),basilisktag,timeoutmillis,coin->basilisk_valuemetric,0,0,0,BASILISK_DEFAULTDIFF));
}

Loading…
Cancel
Save