Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
60cc35be95
  1. 2
      iguana/iguana777.h
  2. 4
      iguana/iguana_peers.c
  3. 4
      iguana/iguana_recv.c

2
iguana/iguana777.h

@ -390,7 +390,7 @@ struct iguana_bundle
uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime;
int32_t minrequests,numhashes,numissued,numrecv,n,hdrsi,bundleheight,numtxids,numspends,numunspents;
double avetime,threshold,metric; uint64_t datasize,estsize;
struct iguana_block *blocks[IGUANA_MAXBUNDLESIZE];
struct iguana_block *blocks[IGUANA_MAXBUNDLESIZE]; uint32_t issued[IGUANA_MAXBUNDLESIZE];
bits256 prevbundlehash2,hashes[IGUANA_MAXBUNDLESIZE+1],nextbundlehash2,allhash;
struct iguana_ramchain ramchain; uint8_t red,green,blue;
};

4
iguana/iguana_peers.c

@ -900,7 +900,7 @@ int64_t iguana_peerallocated(struct iguana_info *coin,struct iguana_peer *addr)
void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
{
static uint32_t lastping;
struct pollfd fds; uint8_t *buf,serialized[64]; struct iguana_bundlereq *req;
struct pollfd fds; uint8_t *buf; struct iguana_bundlereq *req; //,serialized[64]
int32_t bufsize,flag,run,timeout = coin->polltimeout == 0 ? 10 : coin->polltimeout;
#ifdef IGUANA_PEERALLOC
int32_t i; int64_t remaining; struct OS_memspace *mem[sizeof(addr->SEROUT)/sizeof(*addr->SEROUT)];
@ -989,7 +989,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
}
}
}
if ( 0 && flag == 0 )
if ( flag == 0 )
{
if ( run++ > 1000 )
{

4
iguana/iguana_recv.c

@ -702,11 +702,11 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
if ( (bp= coin->bundles[height/coin->chain->bundlesize]) != 0 && bp->emitfinish == 0 )
{
bundlei = (height % coin->chain->bundlesize);
if ( bundlei < bp->n && bits256_nonz(bp->hashes[bundlei]) > 0 && (block= bp->blocks[bundlei]) != 0 && block->numrequests <= bp->minrequests && block->fpipbits == 0 )//&& block->queued == 0 )//(bp->issued[bundlei] == 0 || now > bp->issued[bundlei]+10) )
if ( bundlei < bp->n && bits256_nonz(bp->hashes[bundlei]) > 0 && (block= bp->blocks[bundlei]) != 0 && block->numrequests <= bp->minrequests && block->fpipbits == 0 && (bp->issued[bundlei] == 0 || now > bp->issued[bundlei]+10) )
{
if ( block->numrequests < 100 )
block->numrequests++;
//block->issued = (uint32_t)time(NULL);;
bp->issued[bundlei] = (uint32_t)time(NULL);;
if ( 0 && (rand() % 100) == 0 )
printf("%s Send auto blockreq.%d [%d] minreq.%d\n",addr->ipaddr,bp->bundleheight+bundlei,block->numrequests,bp->minrequests);
iguana_sendblockreq(coin,addr,bp,bundlei,bp->hashes[bundlei],0);

Loading…
Cancel
Save