Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
aae9849104
  1. 11
      iguana/iguana_bundles.c
  2. 4
      iguana/iguana_recv.c
  3. 2
      iguana/main.c

11
iguana/iguana_bundles.c

@ -381,14 +381,15 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
starti = coin->current->hdrsi;
else starti = 0;
priority = (bp->hdrsi < starti + coin->peers.numranked);
lag = (bp->hdrsi - starti);
/*lag = (bp->hdrsi - starti);
lag *= lag;
if ( (i= sqrt(bp->hdrsi)) < 2 )
i = 2;
if ( lag < i )
lag = i;
else if ( lag > 10*i )
lag = 10*i;
lag = 10*i;*/
lag = 10;
if ( (numpeers= coin->peers.numranked) > 8 )//&& bp->currentflag < bp->n )
{
if ( bp->currentflag == 0 )
@ -525,7 +526,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
}
}
if ( flag != 0 && priority != 0 && laggard != 0 )
printf("reissued.%d currentflag.%d ht.%d s.%d finished.%d most.%d laggards.%d maxunfinished.%d\n",flag,bp->currentflag,bp->bundleheight,bp->numsaved,finished,doneval,laggard,maxval);
printf("[%d] reissued.%d currentflag.%d ht.%d s.%d finished.%d most.%d laggards.%d maxunfinished.%d\n",bp->hdrsi,flag,bp->currentflag,bp->bundleheight,bp->numsaved,finished,doneval,laggard,maxval);
}
}
if ( bp == coin->current )
@ -747,7 +748,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
coin->numbundlesQ--;
iguana_bundlecalcs(coin,bp);
//printf("ITER now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
bp->nexttime = (uint32_t)(time(NULL) + 1*0);//(bp->hdrsi - starti) + 1);
bp->nexttime = (uint32_t)(time(NULL) + 1);//(bp->hdrsi - starti) + 1);
if ( bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize )
iguana_bundlehdr(coin,bp,starti);
else if ( bp->emitfinish != 0 )
@ -794,7 +795,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
{
max = bp->n;
counter = iguana_bundleissue(coin,bp,max,timelimit);
if ( 0 && counter > 0 )
if ( 1 && counter > 0 )
printf("ITER now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
}
iguana_bundleQ(coin,bp,1000);

4
iguana/iguana_recv.c

@ -743,7 +743,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
{
block->req = req;
req = 0;
} else printf("already have cache entry.(%s)\n",bits256_str(str,origblock->RO.hash2));
} //else printf("already have cache entry.(%s)\n",bits256_str(str,origblock->RO.hash2));
//fprintf(stderr,"bundleset block.%p vs origblock.%p prev.%d bits.%x fpos.%ld\n",block,origblock,bits256_nonz(prevhash2),block->fpipbits,block->fpos);
} else printf("got origblock.%s to cache\n",bits256_str(str,origblock->RO.hash2));
}
@ -1158,7 +1158,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
}
if ( bp == 0 || z != 0 )
{
//printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0);
printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0);
iguana_send(coin,addr,serialized,datalen);
addr->pendhdrs++;
flag++;

2
iguana/main.c

@ -1117,7 +1117,7 @@ void iguana_main(void *arg)
sleep(1);
char *str;
//iguana_launchcoin(MYINFO.rpcsymbol,cJSON_Parse("{}"));
if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"startpend\":1024,\"endpend\":1024,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":64,\"poll\":1}"),0)) != 0 )
if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"startpend\":1024,\"endpend\":1024,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":64,\"poll\":1}"),0)) != 0 )
{
free(str);
if ( 0 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0)) != 0 )

Loading…
Cancel
Save