diff --git a/deprecated/obsolete.h b/deprecated/obsolete.h index 9f9cd0801..fa4a57767 100644 --- a/deprecated/obsolete.h +++ b/deprecated/obsolete.h @@ -11206,5 +11206,17 @@ void iguana_dedicatedrecv(void *arg) } } } - + if ( 0 && coin->newramchain != 0 && now > coin->savedblocks+60 ) + { + char fname[512]; FILE *fp; + sprintf(fname,"blocks.%s",coin->symbol), OS_compatible_path(fname); + if ( (fp= fopen(fname,"wb")) != 0 ) + { + if ( fwrite(coin->blocks.RO,sizeof(*coin->blocks.RO),coin->longestchain,fp) != coin->longestchain ) + printf("error saving blocks\n"); + else printf("%s saved\n",fname); + fclose(fp); + coin->savedblocks = (uint32_t)time(NULL); + } + } #endif diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 198a1693e..42fca6cda 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -356,25 +356,13 @@ void iguana_coinloop(void *arg) bp->bundleheight = 0; while ( 1 ) { + //printf("iter\n"); flag = 0; for (i=0; inewramchain != 0 && now > coin->savedblocks+60 ) - { - char fname[512]; FILE *fp; - sprintf(fname,"blocks.%s",coin->symbol), OS_compatible_path(fname); - if ( (fp= fopen(fname,"wb")) != 0 ) - { - if ( fwrite(coin->blocks.RO,sizeof(*coin->blocks.RO),coin->longestchain,fp) != coin->longestchain ) - printf("error saving blocks\n"); - else printf("%s saved\n",fname); - fclose(fp); - coin->savedblocks = (uint32_t)time(NULL); - } - } if ( coin->isRT == 0 && now > coin->startutc+600 && coin->blocksrecv >= coin->longestchain-1 && coin->blocks.hwmchain.height >= coin->longestchain-1 ) { printf(">>>>>>> %s isRT blockrecv.%d vs longest.%d\n",coin->symbol,coin->blocksrecv,coin->longestchain); @@ -384,14 +372,19 @@ void iguana_coinloop(void *arg) coin->MAXPEERS = 8; } if ( coin->peers.numranked != 0 && coin->peers.numranked < (coin->MAXPEERS>>1) && now > coin->lastpossible ) + { + //printf("possible\n"); coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers + } if ( coin->active != 0 ) { if ( now > coin->peers.lastmetrics+6 ) { + //printf("metrics\n"); coin->peers.lastmetrics = iguana_updatemetrics(coin); // ranks peers coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers } + //printf("process\n"); flag += iguana_processrecv(coin); if ( 0 && coin->blocks.parsedblocks < coin->blocks.hwmchain.height-coin->chain->minconfirms ) { @@ -399,13 +392,14 @@ void iguana_coinloop(void *arg) iguana_syncs(coin), flag++; // merge ramchain fragments into full ramchain } lastdisp = (uint32_t)now; + //printf("now.%u\n",now); iguana_bundlestats(coin,str); if ( str[0] != 0 ) { if ( (rand() % 1000) == 0 ) myallocated(0,0); } - iguana_ramchainmerge(coin); + //iguana_ramchainmerge(coin); } }// bp block needs mutex } diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index baf61d803..022449f2f 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -429,8 +429,8 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) bp->numhashes++; } } - bp->metric = 0.; - if ( bp->numsaved > 0 ) + bp->metric = bp->numhashes; + //if ( bp->numsaved > 0 ) { bp->estsize = ((uint64_t)bp->datasize * bp->n) / (bp->numrecv+1); if ( bp->numsaved >= bp->n && bp->emitfinish == 0 ) @@ -441,6 +441,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) } else bp->metric = sqrt((sqrt(fabs(bp->estsize - bp->datasize)) * (bp->n - bp->numsaved)) * (bp->hdrsi + 1)); } + //printf("%f ",bp->metric); return(bp->estsize); } @@ -491,8 +492,8 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) } if ( n > 0 ) { - struct iguana_peer *addr; uint32_t now; struct iguana_block *block; int32_t flag,origissue,j,issue,pend = 0; - flag = 0; + struct iguana_peer *addr; uint32_t now; struct iguana_block *block; int32_t m,flag,origissue,j,issue,pend = 0; + flag = m = 0; sortds(&coin->rankedbps[0][0],n,sizeof(coin->rankedbps[0])); for (i=0; ipeers.numranked; i++) { @@ -503,7 +504,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) if ( origissue < 8 ) origissue = 8; issue = origissue; - while ( issue > 0 ) + while ( issue > 0 && m++ < 100 ) { now = (uint32_t)time(NULL); for (i=0; irankedbps[i][0],coin->rankedbps[i][1],coin->bundles[(int32_t)coin->rankedbps[i][1]]->numrecv);*/ - if ( flag != 0 ) + //if ( flag != 0 ) printf("rem.%d issue.%d pend.%d | numranked.%d\n",n,origissue,pend,coin->peers.numranked); } coin->numremain = n; diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 34bc3793a..4aed190ce 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -390,7 +390,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct iguana_info *coin,struct ig printf("iguana_recvblockhdrs null blocks?\n"); return(req); } - printf("GOT HDRS[%d]\n",n); + printf("GOT HDRS[%d] Q.%d %d\n",n,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ)); if ( blocks != 0 && n > 0 ) { for (i=0; i