Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
c87d4af863
  1. 39
      iguana/iguana777.c
  2. 2
      iguana/iguana_init.c

39
iguana/iguana777.c

@ -809,31 +809,32 @@ void iguana_coinloop(void *arg)
//static int32_t saved; //static int32_t saved;
//if ( saved++ == 0 ) //if ( saved++ == 0 )
// iguana_coinflush(coin,1); // iguana_coinflush(coin,1);
}*/ }*/
if ( myinfo->RELAYID >= 0 ) if ( myinfo->RELAYID >= 0 )
continue;
if ( coin->bindsock >= 0 )
{ {
if ( coin->MAXPEERS > 1 && coin->peers->numranked < IGUANA_MAXPEERS/2 && now > coin->lastpossible+2 ) if ( coin->bindsock >= 0 )
{ {
//fprintf(stderr,"check possible\n"); if ( coin->MAXPEERS > 1 && coin->peers->numranked < IGUANA_MAXPEERS/2 && now > coin->lastpossible+2 )
if ( coin->peers->numranked > 0 && (now % 60) == 0 ) {
iguana_send_ping(myinfo,coin,coin->peers->ranked[rand() % coin->peers->numranked]); //fprintf(stderr,"check possible\n");
coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers if ( coin->peers->numranked > 0 && (now % 60) == 0 )
iguana_send_ping(myinfo,coin,coin->peers->ranked[rand() % coin->peers->numranked]);
coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers
}
} }
} else
else
{
if ( coin->MAXPEERS > 1 && coin->peers->numranked < ((7*coin->MAXPEERS)>>3) && now > coin->lastpossible+10 )
{ {
if ( coin->peers->numranked > 0 && (now % 60) == 0 ) if ( coin->MAXPEERS > 1 && coin->peers->numranked < ((7*coin->MAXPEERS)>>3) && now > coin->lastpossible+10 )
iguana_send_ping(myinfo,coin,coin->peers->ranked[rand() % coin->peers->numranked]); {
coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers if ( coin->peers->numranked > 0 && (now % 60) == 0 )
iguana_send_ping(myinfo,coin,coin->peers->ranked[rand() % coin->peers->numranked]);
coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers
}
}
if ( coin->MAXPEERS > 1 && now > coin->peers->lastmetrics+10 )
{
coin->peers->lastmetrics = iguana_updatemetrics(myinfo,coin); // ranks peers
} }
}
if ( coin->MAXPEERS > 1 && now > coin->peers->lastmetrics+10 )
{
coin->peers->lastmetrics = iguana_updatemetrics(myinfo,coin); // ranks peers
} }
if ( coin->FULLNODE != 0 || coin->VALIDATENODE != 0 || coin->MAXPEERS == 1 ) if ( coin->FULLNODE != 0 || coin->VALIDATENODE != 0 || coin->MAXPEERS == 1 )
{ {

2
iguana/iguana_init.c

@ -289,7 +289,7 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
//printf("parse line.(%s) maxpeers.%d\n",line,coin->MAXPEERS); //printf("parse line.(%s) maxpeers.%d\n",line,coin->MAXPEERS);
if ( iter == 0 ) if ( iter == 0 )
{ {
if ( m < 32 && (m < coin->MAXPEERS/2 && strcmp("BTCD",coin->symbol) != 0) )//&& m < 77.7 ) if ( m < 32 || (m < coin->MAXPEERS/2 && strcmp("BTCD",coin->symbol) != 0) )//&& m < 77.7 )
{ {
if ( 0 && m == 0 ) if ( 0 && m == 0 )
{ {

Loading…
Cancel
Save