Browse Source

test

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

4
iguana/iguana777.h

@ -37,8 +37,8 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_HEADPERCENTAGE 0. #define IGUANA_HEADPERCENTAGE 0.
#define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 77 #define _IGUANA_MAXPENDING 8
#define IGUANA_MAXPENDBUNDLES 8 #define IGUANA_MAXPENDBUNDLES 64
#define IGUANA_BUNDLELOOP 3 #define IGUANA_BUNDLELOOP 3
#define IGUANA_RPCPORT 7778 #define IGUANA_RPCPORT 7778
#define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16) #define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16)

9
iguana/iguana_recv.c

@ -53,7 +53,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
coin->numreqsent++; coin->numreqsent++;
addr->pendblocks++; addr->pendblocks++;
addr->pendtime = (uint32_t)time(NULL); addr->pendtime = (uint32_t)time(NULL);
printf("REQ.%s bundlei.%d hdrsi.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1); //printf("REQ.%s bundlei.%d hdrsi.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1);
} else printf("MSG_BLOCK null datalen.%d\n",len); } else printf("MSG_BLOCK null datalen.%d\n",len);
return(len); return(len);
} }
@ -357,7 +357,8 @@ uint32_t iguana_allhashcmp(struct iguana_info *coin,struct iguana_bundle *bp,bit
prev->hh.next = block; prev->hh.next = block;
block->hh.prev = prev; block->hh.prev = prev;
} }
//iguana_blockQ(coin,bp,i,blockhashes[i],0); if ( bp->hdrsi < coin->MAXBUNDLES )
iguana_blockQ(coin,bp,i,blockhashes[i],0);
} else printf("no allhashes block.%p or mismatch.%p\n",block,bp->blocks[i]); } else printf("no allhashes block.%p or mismatch.%p\n",block,bp->blocks[i]);
prev = block; prev = block;
} }
@ -456,7 +457,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int
} }
} }
max = 1 + ((coin->MAXPENDING*coin->MAXPEERS - pend) >> 1); max = 1 + ((coin->MAXPENDING*coin->MAXPEERS - pend) >> 1);
endmillis = OS_milliseconds() + timelimit*10; endmillis = OS_milliseconds() + timelimit;
while ( bp->emitfinish == 0 && OS_milliseconds() < endmillis ) while ( bp->emitfinish == 0 && OS_milliseconds() < endmillis )
{ {
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
@ -489,7 +490,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int
usleep(10000); usleep(10000);
} }
width = 1000 + sqrt(sqrt(bp->n * (1+bp->numsaved+issued)) * (10+coin->bundlescount-bp->hdrsi)); width = 1000 + sqrt(sqrt(bp->n * (1+bp->numsaved+issued)) * (10+coin->bundlescount-bp->hdrsi));
if ( 0 && counter > 0 )//&& bp->rank <= coin->peers.numranked ) //if ( 0 && counter > 0 )//&& bp->rank <= coin->peers.numranked )
printf("ITERATE.%d bundle.%d h.%d n.%d r.%d s.%d F.%d I.%d T.%d %f %u next %f counter.%d\n",bp->rank,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->emitfinish,issued,timelimit,endmillis-OS_milliseconds(),(uint32_t)time(NULL),width,counter); printf("ITERATE.%d bundle.%d h.%d n.%d r.%d s.%d F.%d I.%d T.%d %f %u next %f counter.%d\n",bp->rank,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->emitfinish,issued,timelimit,endmillis-OS_milliseconds(),(uint32_t)time(NULL),width,counter);
if ( bp->emitfinish == 0 ) if ( bp->emitfinish == 0 )
{ {

Loading…
Cancel
Save