Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a33392e6cd
  1. 13
      iguana/iguana_bundles.c
  2. 4
      iguana/iguana_recv.c

13
iguana/iguana_bundles.c

@ -518,7 +518,7 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle
now = (uint32_t)time(NULL);
for (i=0; i<bp->n; i++)
{
if ( GETBIT(bp->haveblock,i) == 0 && now > bp->issued[i]+lag )
if ( bp->issued[i] > 1 && GETBIT(bp->haveblock,i) == 0 && now > bp->issued[i]+lag )
{
iguana_bundleblock(coin,&hash2,bp,i);
if ( bits256_nonz(hash2) != 0 )
@ -527,8 +527,15 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle
printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i);
if ( (addr= coin->peers.ranked[rand() % max]) != 0 && addr->usock >= 0 && addr->dead == 0 )
{
bp->issued[i] = now;
iguana_sendblockreqPT(coin,addr,bp,i,hash2,0);
struct iguana_blockreq *req = 0;
req = mycalloc('y',1,sizeof(*req));
req->hash2 = hash2;
req->bp = bp;
req->height = bp->bundleheight + i;
req->bundlei = i;
bp->issued[i] = 1;
queue_enqueue("missing",&coin->priorityQ,&req->DL,0);
//iguana_sendblockreqPT(coin,addr,bp,i,hash2,0);
}
n++;
}

4
iguana/iguana_recv.c

@ -503,7 +503,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi
if ( 0 && n > 2 && addr != 0 )
printf("addr.%d %s [%d]\n",addr->rank,bits256_str(str,blockhashes[1]),n);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
if ( n > coin->chain->bundlesize )
if ( coin->enableCACHE != 0 && n > coin->chain->bundlesize )
iguana_sendblockreqPT(coin,addr,0,-1,blockhashes[1],0);
}
@ -1340,7 +1340,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
if ( (req->bp= bp) != 0 && bundlei >= 0 )
{
height = bp->bundleheight + bundlei;
bp->issued[bundlei] = now;
bp->issued[bundlei] = 1;
}
req->height = height;
req->bundlei = bundlei;

Loading…
Cancel
Save