|
|
@ -696,7 +696,8 @@ void iguana_coinloop(void *arg) |
|
|
|
} |
|
|
|
if ( coin->started == 0 && coin->active != 0 ) |
|
|
|
{ |
|
|
|
printf("callcoinstart\n"); |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
printf("callcoinstart\n"); |
|
|
|
iguana_callcoinstart(myinfo,coin); |
|
|
|
} |
|
|
|
now = (uint32_t)time(NULL); |
|
|
@ -734,7 +735,8 @@ void iguana_coinloop(void *arg) |
|
|
|
{ |
|
|
|
if ( coin->MAXPEERS > 1 && coin->peers->numranked < ((7*coin->MAXPEERS)>>3) && now > coin->lastpossible+10 ) |
|
|
|
{ |
|
|
|
printf("%s send ping? %d\n",coin->symbol,coin->peers != 0 ? coin->peers->numranked : -1); |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
printf("%s send ping? %d\n",coin->symbol,coin->peers != 0 ? coin->peers->numranked : -1); |
|
|
|
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
|
|
|
@ -742,15 +744,18 @@ void iguana_coinloop(void *arg) |
|
|
|
} |
|
|
|
if ( coin->MAXPEERS > 1 && now > coin->peers->lastmetrics+10 ) |
|
|
|
{ |
|
|
|
fprintf(stderr,"%s call updatemetrics\n",coin->symbol); |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
fprintf(stderr,"%s call updatemetrics\n",coin->symbol); |
|
|
|
coin->peers->lastmetrics = iguana_updatemetrics(myinfo,coin); // ranks peers
|
|
|
|
fprintf(stderr,"%s back updatemetrics\n",coin->symbol); |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
fprintf(stderr,"%s back updatemetrics\n",coin->symbol); |
|
|
|
} |
|
|
|
//if ( coin->longestchain+10000 > coin->blocks.maxbits )
|
|
|
|
// iguana_recvalloc(coin,coin->longestchain + 100000);
|
|
|
|
if ( coin->RELAYNODE != 0 || coin->VALIDATENODE != 0 || coin->MAXPEERS == 1 ) |
|
|
|
{ |
|
|
|
printf("%s call processrecv\n",coin->symbol); |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
printf("%s call processrecv\n",coin->symbol); |
|
|
|
flag += iguana_processrecv(myinfo,coin); |
|
|
|
if ( coin->RTheight > 0 && coin->RTheight > coin->chain->bundlesize ) |
|
|
|
{ |
|
|
@ -760,9 +765,11 @@ void iguana_coinloop(void *arg) |
|
|
|
bp->weights = iguana_PoS_weights(myinfo,coin,&refP,&bp->supply,&bp->numweights,&nonz,&errs,bp->bundleheight); |
|
|
|
} |
|
|
|
} |
|
|
|
printf("%s call jsonQ\n",coin->symbol); |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
printf("%s call jsonQ\n",coin->symbol); |
|
|
|
iguana_jsonQ(); |
|
|
|
} else printf("skip %s\n",coin->symbol); |
|
|
|
} else if ( strcmp(coin->symbol,"BTC") == 0 ) |
|
|
|
printf("skip %s\n",coin->symbol); |
|
|
|
coin->idletime = (uint32_t)time(NULL); |
|
|
|
} |
|
|
|
} |
|
|
|