From c87d4af8638eed341d258d0dff7f7b90fb05cae3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 30 Aug 2016 03:01:37 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 39 ++++++++++++++++++++------------------- iguana/iguana_init.c | 2 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index cb70c830d..64a6987af 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -809,31 +809,32 @@ void iguana_coinloop(void *arg) //static int32_t saved; //if ( saved++ == 0 ) // iguana_coinflush(coin,1); - }*/ + }*/ 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->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 && coin->peers->numranked < IGUANA_MAXPEERS/2 && now > coin->lastpossible+2 ) + { + //fprintf(stderr,"check possible\n"); + 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 - { - if ( coin->MAXPEERS > 1 && coin->peers->numranked < ((7*coin->MAXPEERS)>>3) && now > coin->lastpossible+10 ) + else { - 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 && coin->peers->numranked < ((7*coin->MAXPEERS)>>3) && now > coin->lastpossible+10 ) + { + 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 ) { diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index 59c925c16..c9e2bfa04 100755 --- a/iguana/iguana_init.c +++ b/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); 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 ) {