From 6d704853b8984c6ee442094504607a8622ecb834 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 27 Aug 2016 08:46:24 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 24 ++++++++---------------- iguana/main.c | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 6cdbf3225..303a23367 100755 --- a/basilisk/basilisk.c +++ b/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,24 +799,20 @@ 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 ) + if ( time(NULL) > coin->lastunspentsupdate+10 ) { - //for (i=0; irelay_RTheights[i] != 0 ) - // break; - if ( time(NULL) > coin->lastunspentsupdate+10 ) //i == BASILISK_MAXRELAYS || - { - //printf(">>>>>>>>>>>>> update\n"); - basilisk_unspents_update(myinfo,coin); - coin->lastunspentsupdate = (uint32_t)time(NULL); - } + //printf(">>>>>>>>>>>>> update\n"); + basilisk_unspents_update(myinfo,coin); + coin->lastunspentsupdate = (uint32_t)time(NULL); } } //if ( (myinfo->RELAYID >= 0 || time(NULL) < myinfo->DEXactive) ) @@ -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" diff --git a/iguana/main.c b/iguana/main.c index 8824ca7c9..2a1bac4cb 100755 --- a/iguana/main.c +++ b/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 )