Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d58074585e
  1. 2
      iguana/iguana777.h
  2. 45
      iguana/iguana_recv.c

2
iguana/iguana777.h

@ -35,7 +35,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_HEADPERCENTAGE .00777
#define IGUANA_TAILPERCENTAGE 1.
#define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 8
#define _IGUANA_MAXPENDING 64
#define _IGUANA_MAXBUNDLES 8
#define IGUANA_BUNDLELOOP 3
#define IGUANA_RPCPORT 7778

45
iguana/iguana_recv.c

@ -1031,28 +1031,33 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
int32_t hdrsi,lflag,n,bundlei,flag = 0; bits256 hash2; struct iguana_block *next,*block; struct iguana_bundle *bp;
if ( queue_size(&coin->priorityQ) == 0 && (bp= coin->current) != 0 && bp->numsaved < bp->n )
{
for (bundlei=n=0; bundlei<bp->n; bundlei++)
if ( (block= bp->blocks[bundlei]) != 0 )
{
if ( bits256_nonz(block->RO.hash2) > 0 && block->fpipbits != 0 )
n++;
else if ( bp->numsaved > bp->n*.9 && time(NULL) > block->issued+13 )
for (hdrsi=0; hdrsi<8&&coin->current->hdrsi+hdrsi<coin->bundlescount; hdrsi++)
{
if ( (bp= coin->bundles[hdrsi + coin->current->hdrsi]) == 0 )
break;
for (bundlei=n=0; bundlei<bp->n; bundlei++)
if ( (block= bp->blocks[bundlei]) != 0 )
{
char str[65];
//printf("%d ",bundlei);
printf("[%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
/*block->fpipbits = 0;
block->queued = 0;
block->issued = 0;
bp->issued[bundlei] = 0;*/
block->issued = (uint32_t)time(NULL);
iguana_sendblockreqPT(coin,coin->peers.ranked[0],bp,bundlei,block->RO.hash2,0);
//iguana_blockQ(coin,bp,bundlei,block->RO.hash2,1);
flag++;
if ( bits256_nonz(block->RO.hash2) > 0 && block->fpipbits != 0 )
n++;
else if ( bp->numsaved > bp->n*.9 && time(NULL) > block->issued+13 )
{
char str[65];
//printf("%d ",bundlei);
printf("[%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
/*block->fpipbits = 0;
block->queued = 0;
block->issued = 0;
bp->issued[bundlei] = 0;*/
block->issued = (uint32_t)time(NULL);
iguana_sendblockreqPT(coin,coin->peers.ranked[0],bp,bundlei,block->RO.hash2,0);
//iguana_blockQ(coin,bp,bundlei,block->RO.hash2,1);
flag++;
}
}
}
if ( flag != 0 )
printf("issued %d priority blocks for current.[%d] have %d blocks emit.%u\n",flag,bp->hdrsi,n,bp->emitfinish);
if ( flag != 0 )
printf("issued %d priority blocks for current.[%d] have %d blocks emit.%u\n",flag,bp->hdrsi,n,bp->emitfinish);
}
}
hdrsi = (coin->blocks.hwmchain.height+1) / coin->chain->bundlesize;
if ( (bp= coin->bundles[hdrsi]) != 0 )

Loading…
Cancel
Save