Browse Source

test

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

2
iguana/iguana777.h

@ -38,7 +38,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 8
#define IGUANA_MAXPENDBUNDLES 128
#define IGUANA_MAXPENDBUNDLES 1
#define IGUANA_BUNDLELOOP 3
#define IGUANA_RPCPORT 7778
#define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16)

15
iguana/iguana_recv.c

@ -528,7 +528,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int
block->fpipbits = 0;
block->issued = 0;
bp->issued[i] = 0;
//iguana_blockQ(coin,bp,i,block->RO.hash2,bp->hdrsi == starti);
iguana_blockQ(coin,bp,i,block->RO.hash2,0);
iguana_bundleQ(coin,bp,counter == 0 ? bp->n*5 : bp->n*2);
return(0);
}
@ -668,6 +668,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
if ( num < 2 )
return(req);
iguana_bundlefind(coin,&bp,&bundlei,blockhashes[1]);
iguana_blockQ(coin,0,-1,blockhashes[1],1);
//char str[65];
//if ( bp != 0 && bp->hdrsi == 0 )
// printf("blockhashes[%d] %d of %d %s bp.%d[%d]\n",num,bp==0?-1:bp->hdrsi,coin->bundlescount,bits256_str(str,blockhashes[1]),bp==0?-1:bp->bundleheight,bundlei);
@ -677,7 +678,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
blockhashes[0] = bp->hashes[0];
if ( num >= coin->chain->bundlesize )
{
iguana_blockQ(coin,0,-1,blockhashes[coin->chain->bundlesize],1);
iguana_blockQ(coin,0,-1,blockhashes[coin->chain->bundlesize],0);
//printf("call allhashes\n");
if ( bp->hdrsi == coin->bundlescount-1 )
{
@ -716,9 +717,9 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
if ( iguana_allhashcmp(coin,bp,blockhashes,coin->chain->bundlesize) > 0 )
{
bp->hdrtime = (uint32_t)time(NULL);
iguana_blockQ(coin,bp,1,blockhashes[1],1);
iguana_blockQ(coin,bp,0,blockhashes[0],1);
iguana_blockQ(coin,bp,coin->chain->bundlesize-1,blockhashes[coin->chain->bundlesize-1],1);
iguana_blockQ(coin,bp,1,blockhashes[1],0);
iguana_blockQ(coin,bp,0,blockhashes[0],0);
iguana_blockQ(coin,bp,coin->chain->bundlesize-1,blockhashes[coin->chain->bundlesize-1],0);
//printf("matched bundle.%d\n",bp->bundleheight);
return(req);
} else printf("unexpected mismatch??\n");
@ -729,7 +730,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
struct iguana_block *block;
if ( num == coin->chain->bundlesize+1 && (block= iguana_blockhashset(coin,-1,blockhashes[1],1)) != 0 )
block->blockhashes = blockhashes, req->hashes = 0;
iguana_blockQ(coin,0,-1,blockhashes[1],1);
iguana_blockQ(coin,0,-1,blockhashes[1],0);
}
else iguana_blockQ(coin,0,-1,blockhashes[1],0); // should be RT block
return(req);
@ -740,7 +741,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
struct iguana_bundle *bp=0; int32_t bundlei = -2; struct iguana_block *block;
bp = iguana_bundleset(coin,&block,&bundlei,origblock);
static int total; char str[65];
//if ( bundlei == 1 || bp == coin->current )
if ( bundlei == 1 || bp == coin->current )
fprintf(stderr,"RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
if ( bundlei == 1 && bp != 0 && bp->numhashes < bp->n )
{

Loading…
Cancel
Save