Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
9744cdb12e
  1. 2
      iguana/iguana777.h
  2. 7
      iguana/iguana_blocks.c
  3. 6
      iguana/iguana_recv.c

2
iguana/iguana777.h

@ -29,7 +29,7 @@
#define IGUANA_HEIGHT 200 #define IGUANA_HEIGHT 200
#define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 64 //64 #define _IGUANA_MAXPENDING 3 //64
#define _IGUANA_MAXBUNDLES 8 #define _IGUANA_MAXBUNDLES 8
#define IGUANA_MAXACTIVEBUNDLES 32 #define IGUANA_MAXACTIVEBUNDLES 32
#define IGUANA_MAXFILES 4096 #define IGUANA_MAXFILES 4096

7
iguana/iguana_blocks.c

@ -327,11 +327,11 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
coin->longestchain = block->height+1; coin->longestchain = block->height+1;
if ( (block->height % 1000) == 0 ) if ( (block->height % 1000) == 0 )
printf("EXTENDMAIN %s %d <- (%s) n.%u max.%u PoW %f numtx.%d valid.%d\n",str,block->height,str2,hwmchain->height+1,coin->blocks.maxblocks,block->PoW,block->RO.txn_count,block->valid); printf("EXTENDMAIN %s %d <- (%s) n.%u max.%u PoW %f numtx.%d valid.%d\n",str,block->height,str2,hwmchain->height+1,coin->blocks.maxblocks,block->PoW,block->RO.txn_count,block->valid);
struct iguana_bundle *bp;
if ( (block->height % coin->chain->bundlesize) == 0 ) if ( (block->height % coin->chain->bundlesize) == 0 )
iguana_bundlecreate(coin,&bundlei,block->height,block->RO.hash2,zero,1); bp = iguana_bundlecreate(coin,&bundlei,block->height,block->RO.hash2,zero,1);
else else
{ {
struct iguana_bundle *bp;
if ( (bp= coin->bundles[block->height / coin->chain->bundlesize]) != 0 ) if ( (bp= coin->bundles[block->height / coin->chain->bundlesize]) != 0 )
{ {
if ( memcmp(bp->hashes[block->height % coin->chain->bundlesize].bytes,block->RO.hash2.bytes,sizeof(bits256)) != 0 ) if ( memcmp(bp->hashes[block->height % coin->chain->bundlesize].bytes,block->RO.hash2.bytes,sizeof(bits256)) != 0 )
@ -346,7 +346,8 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
} }
} }
} }
// need to set bp->hash[] here if ( block->fpipbits == 0 )
iguana_blockQ(coin,bp,block->height % coin->chain->bundlesize,block->RO.hash2,1);
block->mainchain = 1; block->mainchain = 1;
return(block); return(block);
} }

6
iguana/iguana_recv.c

@ -671,7 +671,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
limit = 1; limit = 1;
//if ( addr->pendblocks >= limit ) //if ( addr->pendblocks >= limit )
// printf("%s %d overlimit.%d\n",addr->ipaddr,addr->pendblocks,limit); // printf("%s %d overlimit.%d\n",addr->ipaddr,addr->pendblocks,limit);
if ( coin->bundlescount > 0 && (req= queue_dequeue(&coin->priorityQ,0)) == 0 && addr->pendblocks < limit )//&& now > addr->lastpoll ) if ( coin->bundlescount > 0 && (req= queue_dequeue(&coin->priorityQ,0)) == 0 )//addr->pendblocks < limit )//&& now > addr->lastpoll )
{ {
if ( 0 )//strcmp("BTC",coin->symbol) != 0 ) if ( 0 )//strcmp("BTC",coin->symbol) != 0 )
{ {
@ -759,7 +759,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
i = (bestbp->hdrsi + k) % coin->bundlescount; i = (bestbp->hdrsi + k) % coin->bundlescount;
if ( (bp= coin->bundles[i]) == 0 || bp->emitfinish != 0 ) if ( (bp= coin->bundles[i]) == 0 || bp->emitfinish != 0 )
continue; continue;
printf("%.15f ref.%d addrind.%d bestbp.%d\n",bestmetric,refbundlei,addr->addrind,bp->hdrsi); //printf("%.15f ref.%d addrind.%d bestbp.%d\n",bestmetric,refbundlei,addr->addrind,bp->hdrsi);
m = coin->chain->bundlesize; m = coin->chain->bundlesize;
if ( bp->n < m ) if ( bp->n < m )
m = bp->n; m = bp->n;
@ -774,7 +774,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
if ( block->numrequests < 100 ) if ( block->numrequests < 100 )
block->numrequests++; block->numrequests++;
//block->issued = (uint32_t)time(NULL);; //block->issued = (uint32_t)time(NULL);;
printf("%s Send auto blockreq.%d\n",addr->ipaddr,bp->bundleheight+j); //printf("%s Send auto blockreq.%d\n",addr->ipaddr,bp->bundleheight+j);
iguana_sendblockreq(coin,addr,bp,j,hash2,0); iguana_sendblockreq(coin,addr,bp,j,hash2,0);
return(1); return(1);
} }

Loading…
Cancel
Save