Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
ee33885aca
  1. 43
      iguana/iguana_bundles.c

43
iguana/iguana_bundles.c

@ -392,10 +392,18 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
if ( block->peerid == 0 ) if ( block->peerid == 0 )
{ {
//printf("<%d> ",i); //printf("<%d> ",i);
hashes[k++] = bp->hashes[i]; if ( block->fpipbits != 0 )
block->issued = now; {
block->peerid = j + 1; hashes[k++] = bp->hashes[i];
block->numrequests++; block->issued = now;
block->peerid = j + 1;
block->numrequests++;
}
else
{
block->peerid = 1;
block->numrequests++;
}
} }
else else
{ {
@ -405,7 +413,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
if ( peercounts[block->peerid - 1] > maxval ) if ( peercounts[block->peerid - 1] > maxval )
maxval = peercounts[block->peerid - 1]; maxval = peercounts[block->peerid - 1];
} }
else if ( block->fpipbits != 0 && block->fpos >= 0 ) else if ( block->fpipbits != 0 )//&& block->fpos >= 0 )
{ {
donecounts[block->peerid - 1]++; donecounts[block->peerid - 1]++;
if ( donecounts[block->peerid - 1] > minval ) if ( donecounts[block->peerid - 1] > minval )
@ -444,7 +452,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
for (i=j; i<bp->n; i+=numpeers) for (i=j; i<bp->n; i+=numpeers)
if ( (block= bp->blocks[i]) != 0 && (oldest == 0 || block->issued < oldest->issued) ) if ( (block= bp->blocks[i]) != 0 && (oldest == 0 || block->issued < oldest->issued) )
{ {
if ( now > block->issued+10 ) if ( now > block->issued+1 )
oldest = block; oldest = block;
} }
} }
@ -467,18 +475,21 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
} }
} }
} }
/*if ( bp->numsaved < bp->n*.95 ) if ( bp == coin->current )
{
for (i=0; i<numpeers; i++)
printf("%d ",peercounts[i]);
}
else
{ {
for (i=0; i<bp->n; i++) if ( bp->numsaved < bp->n*.95 )
if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 ) {
printf("[%d:%d] ",bp->hdrsi,i); for (i=0; i<numpeers; i++)
printf("%d ",peercounts[i]);
}
else
{
for (i=0; i<bp->n; i++)
if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 )
printf("[%d:%d] ",bp->hdrsi,i);
}
printf("currentflag.%d %d\n",bp->currentflag,bp->bundleheight);
} }
printf("currentflag.%d %d\n",bp->currentflag,bp->bundleheight);*/
return(counter); return(counter);
} }
/*if ( 0 && time(NULL) > bp->lastspeculative+60 ) /*if ( 0 && time(NULL) > bp->lastspeculative+60 )

Loading…
Cancel
Save