Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
248ec47d6b
  1. 2
      iguana/iguana_bundles.c
  2. 7
      iguana/iguana_recv.c

2
iguana/iguana_bundles.c

@ -516,7 +516,7 @@ int32_t iguana_blocksmissing(struct iguana_info *coin,int32_t *nonzp,uint8_t mis
int32_t iguana_sendhashes(struct iguana_info *coin,struct iguana_peer *addr,int32_t msgtype,bits256 hashes[],int32_t n,int32_t priority)
{
int32_t len; uint8_t *serialized;
if ( addr->usock >= 0 && addr->dead == 0 && priority > 1 )
if ( addr->usock >= 0 && addr->dead == 0 && priority > 1 && netBLOCKS < coin->chain->bundlesize*100 )
{
serialized = malloc((sizeof(int32_t) + sizeof(*hashes))*n + 1024);
if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,hashes,n)) > 0 )

7
iguana/iguana_recv.c

@ -1118,6 +1118,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
{
double threshold,lag = OS_milliseconds() - coin->backstopmillis;
bp = coin->bundles[(coin->blocks.hwmchain.height+1)/coin->chain->bundlesize];
threshold = 1000;
if ( bp != 0 && bp->durationscount != 0 )
threshold = (double)bp->totaldurations / bp->durationscount;
else
@ -1157,7 +1158,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
flag++;
char str[65];
if ( 1 && (rand() % 10000) == 0 )//|| bp->bundleheight > coin->longestchain-coin->chain->bundlesize )
printf("%s %s MAIN.%d t %.3flag %.3f\n",coin->symbol,bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,lag);
printf("%s %s MAIN.%d t %.3f lag %.3f\n",coin->symbol,bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,lag);
}
if ( 0 && bp != 0 && bundlei < bp->n-1 && (bits256_nonz(bp->hashes[bundlei+1]) != 0 || (bp->speculative != 0 && bits256_nonz(bp->speculative[bundlei+1]) != 0)) )
{
@ -1496,7 +1497,7 @@ int32_t iguana_processrecv(struct iguana_info *coin) // single threaded
iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG);
}
//printf("call _iguana_chainlink\n");
for (i=coin->blocks.hwmchain.height%coin->chain->bundlesize; i<coin->chain->bundlesize; i++)
/*for (i=coin->blocks.hwmchain.height%coin->chain->bundlesize; i<coin->chain->bundlesize; i++)
{
if ( (bp= coin->current) != 0 && (block= bp->blocks[i]) != 0 )
{
@ -1505,7 +1506,7 @@ int32_t iguana_processrecv(struct iguana_info *coin) // single threaded
iguana_blockQ("mainchain",coin,bp,-i,block->RO.hash2,1);
//iguana_realtime_update(coin);
}
}
}*/
for (i=0; i<coin->chain->bundlesize; i++)
{
if ( iguana_realtime_update(coin) <= 0 )

Loading…
Cancel
Save