|
@ -141,7 +141,9 @@ struct basilisk_item *basilisk_itemcreate(struct supernet_info *myinfo,char *CMD |
|
|
ptr->numrequired = 1; |
|
|
ptr->numrequired = 1; |
|
|
strcpy(ptr->CMD,CMD); |
|
|
strcpy(ptr->CMD,CMD); |
|
|
safecopy(ptr->symbol,symbol,sizeof(ptr->symbol)); |
|
|
safecopy(ptr->symbol,symbol,sizeof(ptr->symbol)); |
|
|
|
|
|
ptr->duration = timeoutmillis; |
|
|
ptr->expiration = OS_milliseconds() + timeoutmillis; |
|
|
ptr->expiration = OS_milliseconds() + timeoutmillis; |
|
|
|
|
|
//printf("itemcreate.%p %s %f timeout.%d\n",ptr,CMD,OS_milliseconds(),timeoutmillis);
|
|
|
return(ptr); |
|
|
return(ptr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -335,7 +337,7 @@ void basilisk_sendback(struct supernet_info *myinfo,char *origCMD,char *symbol,c |
|
|
|
|
|
|
|
|
struct basilisk_item *basilisk_issueremote(struct supernet_info *myinfo,struct iguana_peer *addr,int32_t *numsentp,char *CMD,char *symbol,int32_t blockflag,cJSON *valsobj,int32_t fanout,int32_t numrequired,uint32_t basilisktag,int32_t timeoutmillis,void *deprecated_dontuse,char *retstr,int32_t encryptflag,int32_t delaymillis,uint32_t nBits) |
|
|
struct basilisk_item *basilisk_issueremote(struct supernet_info *myinfo,struct iguana_peer *addr,int32_t *numsentp,char *CMD,char *symbol,int32_t blockflag,cJSON *valsobj,int32_t fanout,int32_t numrequired,uint32_t basilisktag,int32_t timeoutmillis,void *deprecated_dontuse,char *retstr,int32_t encryptflag,int32_t delaymillis,uint32_t nBits) |
|
|
{ |
|
|
{ |
|
|
struct basilisk_item *pending; uint8_t *allocptr,*data,space[4096]; int32_t datalen; cJSON *retarray; |
|
|
struct basilisk_item *pending; uint8_t *allocptr,*data,space[4096]; int32_t datalen; |
|
|
pending = basilisk_itemcreate(myinfo,CMD,symbol,basilisktag,numrequired,valsobj,timeoutmillis,0); |
|
|
pending = basilisk_itemcreate(myinfo,CMD,symbol,basilisktag,numrequired,valsobj,timeoutmillis,0); |
|
|
pending->nBits = nBits; |
|
|
pending->nBits = nBits; |
|
|
*numsentp = 0; |
|
|
*numsentp = 0; |
|
@ -356,31 +358,23 @@ struct basilisk_item *basilisk_issueremote(struct supernet_info *myinfo,struct i |
|
|
HASH_ADD(hh,myinfo->basilisks.issued,basilisktag,sizeof(basilisktag),pending); |
|
|
HASH_ADD(hh,myinfo->basilisks.issued,basilisktag,sizeof(basilisktag),pending); |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
if ( pending->expiration <= OS_milliseconds() ) |
|
|
if ( pending->expiration <= OS_milliseconds() ) |
|
|
pending->expiration = OS_milliseconds() + BASILISK_TIMEOUT; |
|
|
pending->expiration = OS_milliseconds() + pending->duration; |
|
|
strcpy(pending->symbol,"BTCD"); |
|
|
strcpy(pending->symbol,"NOTARY"); |
|
|
strcpy(pending->CMD,CMD); |
|
|
strcpy(pending->CMD,CMD); |
|
|
|
|
|
//printf("block for %f\n",pending->expiration - OS_milliseconds());
|
|
|
while ( OS_milliseconds() < pending->expiration ) |
|
|
while ( OS_milliseconds() < pending->expiration ) |
|
|
{ |
|
|
{ |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
if ( pending->numresults >= pending->numrequired )//|| (retstr= pending->retstr) != 0 )
|
|
|
if ( pending->numresults >= pending->numrequired ) |
|
|
{ |
|
|
{ |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
//printf("<<<<<<<<<<<<< numresults.%d vs numrequired.%d\n",pending->numresults,pending->numrequired);
|
|
|
//printf("%p <<<<<<<<<<<<< numresults.%d vs numrequired.%d\n",pending,pending->numresults,pending->numrequired);
|
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
usleep(10000); |
|
|
usleep(10000); |
|
|
} |
|
|
} |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
|
|
|
if ( (retarray= pending->retarray) != 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
pending->retstr = jprint(retarray,0); |
|
|
|
|
|
printf("num.%d:%d required.%d RETSTR.(%s)\n",pending->numresults,cJSON_GetArraySize(pending->retarray),pending->numrequired,pending->retstr); |
|
|
|
|
|
pending->retarray = 0; |
|
|
|
|
|
free_json(retarray); |
|
|
|
|
|
} |
|
|
} |
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
|
|
|
} else free(pending), pending = 0; //ptr->finished = (uint32_t)time(NULL);
|
|
|
|
|
|
if ( allocptr != 0 ) |
|
|
if ( allocptr != 0 ) |
|
|
free(allocptr); |
|
|
free(allocptr); |
|
|
} |
|
|
} |
|
@ -409,7 +403,7 @@ struct basilisk_item *basilisk_requestservice(struct supernet_info *myinfo,struc |
|
|
if ( fanout < minfanout ) |
|
|
if ( fanout < minfanout ) |
|
|
fanout = minfanout; |
|
|
fanout = minfanout; |
|
|
if ( (numrequired= jint(valsobj,"numrequired")) <= 0 ) |
|
|
if ( (numrequired= jint(valsobj,"numrequired")) <= 0 ) |
|
|
numrequired = MIN(fanout,sqrt(myinfo->NOTARY.NUMRELAYS)+1); |
|
|
numrequired = MIN(fanout/2,sqrt(myinfo->NOTARY.NUMRELAYS)+1); |
|
|
if ( (symbol= jstr(valsobj,"coin")) != 0 || (symbol= jstr(valsobj,"symbol")) != 0 ) |
|
|
if ( (symbol= jstr(valsobj,"coin")) != 0 || (symbol= jstr(valsobj,"symbol")) != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (virt= iguana_coinfind(symbol)) != 0 ) |
|
|
if ( (virt= iguana_coinfind(symbol)) != 0 ) |
|
@ -420,7 +414,7 @@ struct basilisk_item *basilisk_requestservice(struct supernet_info *myinfo,struc |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if ( symbol == 0 ) |
|
|
if ( symbol == 0 ) |
|
|
symbol = "BTCD"; |
|
|
symbol = "NOTARY"; |
|
|
encryptflag = jint(valsobj,"encrypt"); |
|
|
encryptflag = jint(valsobj,"encrypt"); |
|
|
delaymillis = jint(valsobj,"delay"); |
|
|
delaymillis = jint(valsobj,"delay"); |
|
|
ptr = basilisk_issueremote(myinfo,addr,&numsent,CMD,symbol,blockflag,valsobj,fanout,numrequired,0,timeoutmillis,0,0,encryptflag,delaymillis,nBits); |
|
|
ptr = basilisk_issueremote(myinfo,addr,&numsent,CMD,symbol,blockflag,valsobj,fanout,numrequired,0,timeoutmillis,0,0,encryptflag,delaymillis,nBits); |
|
@ -429,7 +423,7 @@ struct basilisk_item *basilisk_requestservice(struct supernet_info *myinfo,struc |
|
|
|
|
|
|
|
|
char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_addr,bits256 hash,cJSON *valsobj,char *hexstr,int32_t blockflag) // client side
|
|
|
char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_addr,bits256 hash,cJSON *valsobj,char *hexstr,int32_t blockflag) // client side
|
|
|
{ |
|
|
{ |
|
|
uint32_t nBits = 0; uint8_t space[4096],*allocptr=0,*data = 0; struct basilisk_item *ptr; int32_t datalen = 0; cJSON *retjson; char *retstr=0; |
|
|
uint32_t nBits = 0; uint8_t space[4096],*allocptr=0,*data = 0; struct basilisk_item *ptr; int32_t i,datalen = 0; cJSON *retjson; char *retstr=0; |
|
|
if ( myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0 && (strcmp(CMD,"INF") != 0 && basilisk_notarycmd(CMD) == 0) ) |
|
|
if ( myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0 && (strcmp(CMD,"INF") != 0 && basilisk_notarycmd(CMD) == 0) ) |
|
|
return(clonestr("{\"error\":\"unsupported special relay command\"}")); |
|
|
return(clonestr("{\"error\":\"unsupported special relay command\"}")); |
|
|
data = get_dataptr(BASILISK_HDROFFSET,&allocptr,&datalen,space,sizeof(space),hexstr); |
|
|
data = get_dataptr(BASILISK_HDROFFSET,&allocptr,&datalen,space,sizeof(space),hexstr); |
|
@ -439,8 +433,17 @@ char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_add |
|
|
free(allocptr); |
|
|
free(allocptr); |
|
|
if ( ptr != 0 ) |
|
|
if ( ptr != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( ptr->retstr != 0 ) |
|
|
if ( (retstr= ptr->retstr) != 0 ) |
|
|
retstr = ptr->retstr, ptr->retstr = 0; |
|
|
ptr->retstr = 0; |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
if ( ptr->numresults > 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
retjson = cJSON_CreateArray(); |
|
|
|
|
|
for (i=0; i<ptr->numresults; i++) |
|
|
|
|
|
jaddi(retjson,ptr->results[i]), ptr->results[i] = 0; |
|
|
|
|
|
//printf("numresults.%d (%p)\n",ptr->numresults,ptr);
|
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
retjson = cJSON_CreateObject(); |
|
|
retjson = cJSON_CreateObject(); |
|
@ -450,12 +453,13 @@ char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_add |
|
|
jaddstr(retjson,"result","error"); |
|
|
jaddstr(retjson,"result","error"); |
|
|
jaddnum(retjson,"numsent",ptr->numsent); |
|
|
jaddnum(retjson,"numsent",ptr->numsent); |
|
|
} else jaddstr(retjson,"error","didnt find any nodes to send to"); |
|
|
} else jaddstr(retjson,"error","didnt find any nodes to send to"); |
|
|
|
|
|
} |
|
|
retstr = jprint(retjson,1); |
|
|
retstr = jprint(retjson,1); |
|
|
} |
|
|
} |
|
|
ptr->finished = (uint32_t)time(NULL); |
|
|
ptr->finished = OS_milliseconds() + 10000; |
|
|
} |
|
|
} |
|
|
//if ( strcmp("MSG",CMD) == 0 )
|
|
|
if ( 0 && strcmp("MSG",CMD) == 0 ) |
|
|
// printf("%s.(%s) -> (%s)\n",CMD,jprint(valsobj,0),retstr!=0?retstr:"");
|
|
|
printf("%s.(%s) -> (%s)\n",CMD,jprint(valsobj,0),retstr!=0?retstr:""); |
|
|
return(retstr); |
|
|
return(retstr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -588,25 +592,22 @@ void basilisk_result(struct supernet_info *myinfo,char *remoteaddr,uint32_t basi |
|
|
{ |
|
|
{ |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
HASH_FIND(hh,myinfo->basilisks.issued,&basilisktag,sizeof(basilisktag),pending); |
|
|
HASH_FIND(hh,myinfo->basilisks.issued,&basilisktag,sizeof(basilisktag),pending); |
|
|
//printf("HASH_FIND.%p\n",pending);
|
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
if ( pending != 0 && retstr != 0 ) |
|
|
if ( pending != 0 && retstr != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (item= cJSON_Parse(retstr)) != 0 ) |
|
|
if ( (item= cJSON_Parse(retstr)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( pending->retarray == 0 ) |
|
|
|
|
|
pending->retarray = cJSON_CreateArray(); |
|
|
|
|
|
if ( jobj(item,"myip") == 0 ) |
|
|
if ( jobj(item,"myip") == 0 ) |
|
|
jaddstr(item,"myip",remoteaddr); |
|
|
jaddstr(item,"myip",remoteaddr); |
|
|
jaddi(pending->retarray,item); |
|
|
if ( pending->numresults < sizeof(pending->results)/sizeof(*pending->results) ) |
|
|
if ( jobj(item,"error") == 0 ) |
|
|
|
|
|
{ |
|
|
{ |
|
|
printf("numresults.%d:%d (%s)\n",pending->numresults,cJSON_GetArraySize(pending->retarray),jprint(item,0)); |
|
|
//printf("%p.(RESULT).%d\n",pending,pending->numresults);
|
|
|
pending->numresults++; |
|
|
pending->results[pending->numresults++] = item; |
|
|
} |
|
|
} |
|
|
} else printf("couldnt parse.(%s)\n",retstr); |
|
|
} else printf("couldnt parse.(%s)\n",retstr); |
|
|
} //else printf("couldnt find issued.%u\n",basilisktag);
|
|
|
} //else printf("couldnt find issued.%u\n",basilisktag);
|
|
|
portable_mutex_unlock(&myinfo->basilisk_mutex); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
free(retstr); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -785,10 +786,10 @@ int32_t basilisk_p2pQ_process(struct supernet_info *myinfo,int32_t maxiters) |
|
|
{ |
|
|
{ |
|
|
len += iguana_rwnum(0,ptr->data,sizeof(basilisktag),&basilisktag); |
|
|
len += iguana_rwnum(0,ptr->data,sizeof(basilisktag),&basilisktag); |
|
|
if ( 0 && myinfo->IAMLP == 0 ) |
|
|
if ( 0 && myinfo->IAMLP == 0 ) |
|
|
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,ptr->datalen,ptr->type,senderip!=0?senderip:"?",basilisktag); |
|
|
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,ptr->datalen,ptr->type,senderip,basilisktag); |
|
|
basilisk_msgprocess(myinfo,ptr->addr,ptr->ipbits,ptr->type,basilisktag,&ptr->data[len],ptr->datalen - len); |
|
|
basilisk_msgprocess(myinfo,ptr->addr,ptr->ipbits,ptr->type,basilisktag,&ptr->data[len],ptr->datalen - len); |
|
|
if ( 0 && myinfo->IAMLP == 0 ) |
|
|
if ( 0 && myinfo->IAMLP == 0 ) |
|
|
printf("processed.%s from %s\n",ptr->type,senderip!=0?senderip:"?"); |
|
|
printf("processed.%s from %s\n",ptr->type,senderip); |
|
|
} |
|
|
} |
|
|
free(ptr); |
|
|
free(ptr); |
|
|
n++; |
|
|
n++; |
|
@ -834,8 +835,13 @@ void basilisk_p2p(struct supernet_info *myinfo,struct iguana_info *coin,struct i |
|
|
|
|
|
|
|
|
void basilisk_requests_poll(struct supernet_info *myinfo) |
|
|
void basilisk_requests_poll(struct supernet_info *myinfo) |
|
|
{ |
|
|
{ |
|
|
|
|
|
static uint32_t lastpoll; |
|
|
char *retstr; uint8_t data[8192]; cJSON *outerarray,*retjson; int32_t datalen,i,n; struct basilisk_request issueR; double hwm = 0.; |
|
|
char *retstr; uint8_t data[8192]; cJSON *outerarray,*retjson; int32_t datalen,i,n; struct basilisk_request issueR; double hwm = 0.; |
|
|
|
|
|
if ( time(NULL) < lastpoll+3 ) |
|
|
|
|
|
return; |
|
|
|
|
|
lastpoll = (uint32_t)time(NULL); |
|
|
memset(&issueR,0,sizeof(issueR)); |
|
|
memset(&issueR,0,sizeof(issueR)); |
|
|
|
|
|
//printf("Call incoming\n");
|
|
|
if ( (retstr= InstantDEX_incoming(myinfo,0,0,0,0)) != 0 ) |
|
|
if ( (retstr= InstantDEX_incoming(myinfo,0,0,0,0)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
//printf("poll.(%s)\n",retstr);
|
|
|
//printf("poll.(%s)\n",retstr);
|
|
@ -876,13 +882,19 @@ void basilisk_requests_poll(struct supernet_info *myinfo) |
|
|
|
|
|
|
|
|
int32_t basilisk_issued_purge(struct supernet_info *myinfo,int32_t timepad) |
|
|
int32_t basilisk_issued_purge(struct supernet_info *myinfo,int32_t timepad) |
|
|
{ |
|
|
{ |
|
|
struct basilisk_item *tmp,*pending; int32_t n = 0; double startmilli = OS_milliseconds(); |
|
|
struct basilisk_item *tmp,*pending; cJSON *item; int32_t i,n = 0; double startmilli = OS_milliseconds(); |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
portable_mutex_lock(&myinfo->basilisk_mutex); |
|
|
HASH_ITER(hh,myinfo->basilisks.issued,pending,tmp) |
|
|
HASH_ITER(hh,myinfo->basilisks.issued,pending,tmp) |
|
|
{ |
|
|
{ |
|
|
if ( pending != 0 && (pending->finished != 0 || startmilli > pending->expiration+timepad) ) |
|
|
if ( pending != 0 && ((pending->finished > 0 && startmilli > pending->finished) || startmilli > pending->expiration+timepad) ) |
|
|
{ |
|
|
{ |
|
|
HASH_DELETE(hh,myinfo->basilisks.issued,pending); |
|
|
HASH_DELETE(hh,myinfo->basilisks.issued,pending); |
|
|
|
|
|
//printf("%f > %f (%d) clear pending.%p numresults.%d %p\n",startmilli,pending->expiration+timepad,timepad,pending,pending->numresults,pending->retstr);
|
|
|
|
|
|
for (i=0; i<pending->numresults; i++) |
|
|
|
|
|
if ( (item= pending->results[i]) != 0 ) |
|
|
|
|
|
free_json(item); |
|
|
|
|
|
if ( pending->retstr != 0 ) |
|
|
|
|
|
free(pending->retstr); |
|
|
memset(pending,0,sizeof(*pending)); |
|
|
memset(pending,0,sizeof(*pending)); |
|
|
free(pending); |
|
|
free(pending); |
|
|
n++; |
|
|
n++; |
|
@ -911,11 +923,11 @@ void basilisk_iteration(struct supernet_info *myinfo) |
|
|
} |
|
|
} |
|
|
}*/ |
|
|
}*/ |
|
|
} |
|
|
} |
|
|
else if ( myinfo->expiration != 0 ) |
|
|
/*else
|
|
|
{ |
|
|
{ |
|
|
if ( myinfo->IAMLP != 0 || myinfo->DEXactive > now ) |
|
|
if ( myinfo->expiration != 0 && (myinfo->IAMLP != 0 || myinfo->DEXactive > now) ) |
|
|
basilisk_requests_poll(myinfo); |
|
|
basilisk_requests_poll(myinfo); |
|
|
} |
|
|
}*/ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void basilisks_loop(void *arg) |
|
|
void basilisks_loop(void *arg) |
|
@ -967,9 +979,9 @@ HASH_ARRAY_STRING(basilisk,balances,hash,vals,hexstr) |
|
|
if ( jobj(vals,"history") == 0 ) |
|
|
if ( jobj(vals,"history") == 0 ) |
|
|
jaddnum(vals,"history",3); |
|
|
jaddnum(vals,"history",3); |
|
|
if ( jobj(vals,"fanout") == 0 ) |
|
|
if ( jobj(vals,"fanout") == 0 ) |
|
|
jaddnum(vals,"fanout",MAX(5,(int32_t)sqrt(myinfo->NOTARY.NUMRELAYS)+1)); |
|
|
jaddnum(vals,"fanout",MAX(8,(int32_t)sqrt(myinfo->NOTARY.NUMRELAYS)+1)); |
|
|
if ( jobj(vals,"numrequired") == 0 ) |
|
|
if ( jobj(vals,"numrequired") == 0 ) |
|
|
jaddnum(vals,"numrequired",juint(vals,"fanout")); |
|
|
jaddnum(vals,"numrequired",MIN(juint(vals,"fanout")/2,(int32_t)sqrt(myinfo->NOTARY.NUMRELAYS))); |
|
|
if ( jobj(vals,"addresses") == 0 ) |
|
|
if ( jobj(vals,"addresses") == 0 ) |
|
|
{ |
|
|
{ |
|
|
jadd(vals,"addresses",iguana_getaddressesbyaccount(myinfo,coin,"*")); |
|
|
jadd(vals,"addresses",iguana_getaddressesbyaccount(myinfo,coin,"*")); |
|
@ -978,7 +990,7 @@ HASH_ARRAY_STRING(basilisk,balances,hash,vals,hexstr) |
|
|
if ( (basilisktag= juint(vals,"basilisktag")) == 0 ) |
|
|
if ( (basilisktag= juint(vals,"basilisktag")) == 0 ) |
|
|
basilisktag = rand(); |
|
|
basilisktag = rand(); |
|
|
if ( (timeoutmillis= juint(vals,"timeout")) <= 0 ) |
|
|
if ( (timeoutmillis= juint(vals,"timeout")) <= 0 ) |
|
|
timeoutmillis = 3000; |
|
|
timeoutmillis = BASILISK_TIMEOUT; |
|
|
if ( coin != 0 ) |
|
|
if ( coin != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( coin->FULLNODE != 0 || coin->VALIDATENODE != 0 ) |
|
|
if ( coin->FULLNODE != 0 || coin->VALIDATENODE != 0 ) |
|
@ -986,7 +998,7 @@ HASH_ARRAY_STRING(basilisk,balances,hash,vals,hexstr) |
|
|
if ( (ptr= basilisk_bitcoinbalances(&Lptr,myinfo,coin,remoteaddr,basilisktag,timeoutmillis,vals)) != 0 ) |
|
|
if ( (ptr= basilisk_bitcoinbalances(&Lptr,myinfo,coin,remoteaddr,basilisktag,timeoutmillis,vals)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
retstr = ptr->retstr, ptr->retstr = 0; |
|
|
retstr = ptr->retstr, ptr->retstr = 0; |
|
|
ptr->finished = (uint32_t)time(NULL); |
|
|
ptr->finished = OS_milliseconds() + 10000; |
|
|
return(retstr); |
|
|
return(retstr); |
|
|
} |
|
|
} |
|
|
return(clonestr("{\"error\":\"no result\"}")); |
|
|
return(clonestr("{\"error\":\"no result\"}")); |
|
|