Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
6d704853b8
  1. 18
      basilisk/basilisk.c
  2. 2
      iguana/main.c

18
basilisk/basilisk.c

@ -733,10 +733,6 @@ void basilisk_p2p(void *_myinfo,void *_addr,char *senderip,uint8_t *data,int32_t
void basilisk_requests_poll(struct supernet_info *myinfo)
{
char *retstr; cJSON *outerarray; int32_t i,n; struct basilisk_request issueR; double hwm = 0.;
if ( myinfo == 0 )
{
;
}
memset(&issueR,0,sizeof(issueR));
if ( (retstr= InstantDEX_incoming(myinfo,0,0,0,0)) != 0 )
{
@ -792,7 +788,6 @@ void basilisks_loop(void *arg)
}
}
portable_mutex_unlock(&myinfo->basilisk_mutex);
//if ( myinfo->allcoins_numvirts > 0 )
if ( (btcd= iguana_coinfind("BTCD")) != 0 )
{
maxmillis = (1000 / (myinfo->allcoins_numvirts + 1)) + 1;
@ -804,26 +799,22 @@ void basilisks_loop(void *arg)
gecko_iteration(myinfo,btcd,virt,maxmillis), flag++;
}
}
//printf("my RELAYID.%d\n",myinfo->RELAYID);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
if ( (rand() % 10) == 0 && myinfo->RELAYID >= 0 )
{
printf("my RELAYID.%d\n",myinfo->RELAYID);
basilisk_ping_send(myinfo,btcd);
}
}
HASH_ITER(hh,myinfo->allcoins,coin,tmpcoin)
{
//if ( coin->RELAYNODE == 0 && coin->VALIDATENODE == 0 )
{
//for (i=0; i<BASILISK_MAXRELAYS; i++)
// if ( coin->relay_RTheights[i] != 0 )
// break;
if ( time(NULL) > coin->lastunspentsupdate+10 ) //i == BASILISK_MAXRELAYS ||
if ( time(NULL) > coin->lastunspentsupdate+10 )
{
//printf(">>>>>>>>>>>>> update\n");
basilisk_unspents_update(myinfo,coin);
coin->lastunspentsupdate = (uint32_t)time(NULL);
}
}
}
//if ( (myinfo->RELAYID >= 0 || time(NULL) < myinfo->DEXactive) )
basilisk_requests_poll(myinfo);
now = (uint32_t)time(NULL);
@ -856,6 +847,7 @@ void basilisks_init(struct supernet_info *myinfo)
portable_mutex_init(&myinfo->gecko_mutex);
portable_mutex_init(&myinfo->messagemutex);
myinfo->basilisks.launched = iguana_launch(iguana_coinfind("BTCD"),"basilisks_loop",basilisks_loop,myinfo,IGUANA_PERMTHREAD);
printf("Basilisk initialized\n");
}
#include "../includes/iguana_apidefs.h"

2
iguana/main.c

@ -525,7 +525,7 @@ void iguana_appletests(struct supernet_info *myinfo)
bitcoin_sharedsecret(myinfo->ctx,hash2,pubkey,33);
printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i);
getchar();**/
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":1,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":1,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )

Loading…
Cancel
Save