Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
3fc7351bfb
  1. 17
      basilisk/basilisk.c
  2. 4
      gecko/gecko_blocks.c
  3. 25
      iguana/iguana777.c

17
basilisk/basilisk.c

@ -519,7 +519,7 @@ void basilisk_result(struct supernet_info *myinfo,char *remoteaddr,uint32_t basi
void basilisks_loop(void *arg) void basilisks_loop(void *arg)
{ {
struct basilisk_item *tmp,*pending; int32_t iter,flag=0; struct supernet_info *myinfo = arg; struct iguana_info *virt,*tmpcoin,*btcd; struct basilisk_item *tmp,*pending; int32_t iter,maxmillis,flag=0; struct supernet_info *myinfo = arg;
iter = 0; iter = 0;
while ( 1 ) while ( 1 )
{ {
@ -533,6 +533,21 @@ void basilisks_loop(void *arg)
} }
} }
portable_mutex_unlock(&myinfo->basilisk_mutex); portable_mutex_unlock(&myinfo->basilisk_mutex);
//if ( myinfo->allcoins_numvirts > 0 )
if ( (btcd= iguana_coinfind("BTCD")) != 0 )
{
maxmillis = (10000 / (myinfo->allcoins_numvirts + 1)) + 1;
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,virt,tmpcoin)
{
if ( virt->started != 0 && virt->active != 0 && virt->virtualchain != 0 )
{
gecko_iteration(myinfo,btcd,virt,maxmillis), flag++;
}
}
//portable_mutex_unlock(&myinfo->allcoins_mutex);
}
//fprintf(stderr,"i "); //fprintf(stderr,"i ");
//for (i=0; i<IGUANA_MAXCOINS; i++) //for (i=0; i<IGUANA_MAXCOINS; i++)
// if ( (coin= Coins[i]) != 0 && coin->RELAYNODE == 0 && coin->VALIDATENODE == 0 && coin->active != 0 && coin->chain->userpass[0] != 0 && coin->MAXPEERS == 1 ) // if ( (coin= Coins[i]) != 0 && coin->RELAYNODE == 0 && coin->VALIDATENODE == 0 && coin->active != 0 && coin->chain->userpass[0] != 0 && coin->MAXPEERS == 1 )

4
gecko/gecko_blocks.c

@ -341,13 +341,13 @@ int32_t basilisk_blocksubmit(struct supernet_info *myinfo,struct iguana_info *bt
free_json(retjson); free_json(retjson);
} }
free(str); free(str);
#ifndef __APPLE__ /*#ifndef __APPLE__
if ( numresults >= (myinfo->numrelays >> 1) ) if ( numresults >= (myinfo->numrelays >> 1) )
#endif #endif
{ {
if ( (str= gecko_blockarrived(myinfo,virt,"127.0.0.1",data,datalen,hash2,0)) != 0 ) if ( (str= gecko_blockarrived(myinfo,virt,"127.0.0.1",data,datalen,hash2,0)) != 0 )
free(str); free(str);
} }*/
} }
} }
if ( allocptr != 0 ) if ( allocptr != 0 )

25
iguana/iguana777.c

@ -553,8 +553,8 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert
void iguana_helper(void *arg) void iguana_helper(void *arg)
{ {
static int32_t maxhelperid; static int32_t maxhelperid;
cJSON *argjson=0; int32_t iter,n,j,maxmillis,polltimeout,type,helperid=rand(),flag,allcurrent,idle=0; cJSON *argjson=0; int32_t iter,n,j,polltimeout,type,helperid=rand(),flag,allcurrent,idle=0;
struct iguana_helper *ptr; struct iguana_info *coin,*btcd,*virt,*tmp; struct OS_memspace MEM,*MEMB; struct iguana_bundle *bp; struct supernet_info *myinfo = SuperNET_MYINFO(0); struct iguana_helper *ptr; struct iguana_info *coin,*tmp; struct OS_memspace MEM,*MEMB; struct iguana_bundle *bp; struct supernet_info *myinfo = SuperNET_MYINFO(0);
if ( arg != 0 && (argjson= cJSON_Parse(arg)) != 0 ) if ( arg != 0 && (argjson= cJSON_Parse(arg)) != 0 )
helperid = juint(argjson,"helperid"); helperid = juint(argjson,"helperid");
if ( helperid > maxhelperid ) if ( helperid > maxhelperid )
@ -576,27 +576,6 @@ void iguana_helper(void *arg)
while ( 1 ) while ( 1 )
{ {
flag = 0; flag = 0;
if ( (btcd= iguana_coinfind("BTCD")) != 0 )
{
//if ( helperid == 0 && myinfo->numrelays > 0 && myinfo->genesisresults == 0 )
// basilisk_geckogenesis(myinfo,btcd,0,0,GENESIS_PUBKEY,0,0);
//if ( myinfo->allcoins_numvirts > 0 )
{
maxmillis = (10000 / (myinfo->allcoins_numvirts + 1)) + 1;
n = 0;
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,virt,tmp)
{
if ( virt->started != 0 && virt->active != 0 && virt->virtualchain != 0 )
{
//fprintf(stderr,"h");
if ( (n++ % IGUANA_NUMHELPERS) == helperid )
gecko_iteration(myinfo,btcd,virt,maxmillis), flag++;
}
}
//portable_mutex_unlock(&myinfo->allcoins_mutex);
}
}
//iguana_jsonQ(); cant do this here //iguana_jsonQ(); cant do this here
allcurrent = 2; allcurrent = 2;
polltimeout = 100; polltimeout = 100;

Loading…
Cancel
Save