Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
52bdb5310e
  1. 2
      iguana/iguana777.c
  2. 1
      iguana/iguana777.h
  3. 6
      iguana/iguana_bundles.c
  4. 3
      iguana/iguana_recv.c
  5. 4
      iguana/main.c

2
iguana/iguana777.c

@ -541,7 +541,7 @@ void iguana_coinloop(void *arg)
//fprintf(stderr,"metrics\n");
coin->peers.lastmetrics = iguana_updatemetrics(coin); // ranks peers
}
iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG);
//iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG);
if ( coin->longestchain+10000 > coin->blocks.maxbits )
iguana_recvalloc(coin,coin->longestchain + 100000);
flag += iguana_processrecv(coin);

1
iguana/iguana777.h

@ -837,6 +837,7 @@ void iguana_spendvectorsQ(struct iguana_info *coin,struct iguana_bundle *bp);
int8_t iguana_blockstatus(struct iguana_info *coin,struct iguana_block *block);
void iguana_peerslotinit(struct iguana_info *coin,struct iguana_peer *addr,int32_t slotid,uint64_t ipbits);
void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,struct iguana_bundle *bp,int32_t i,int32_t deletefile);
int32_t iguana_reqblocks(struct iguana_info *coin);
extern int32_t HDRnet,netBLOCKS;

6
iguana/iguana_bundles.c

@ -875,16 +875,16 @@ int32_t iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,
if ( bp->numissued < bp->n )
max = bp->numissued;
else max = bp->origmissings;
//if ( bp->missingstime == 0 || bp->numissued < bp->n || bp == coin->current || missing < max || time(NULL) > bp->missingstime+lag )
if ( bp->missingstime == 0 || bp->numissued < bp->n || bp == coin->current || missing < max || time(NULL) > bp->missingstime+lag )
{
if ( (n= iguana_bundlerequests(coin,missings,&bp->origmissings,&tmp,bp,lag)) > 0 )
{
printf("bundle.[%d] numissued.%d missings.%d n.%d capacity %d -> %d\n",bp->hdrsi,bp->numissued,bp->origmissings,n,capacity,capacity-n);
bp->numissued += n;
capacity -= n;
bp->missingstime = (uint32_t)time(NULL);
}
}
printf("bundle.[%d] numissued.%d missings.%d n.%d capacity %d -> %d\n",bp->hdrsi,bp->numissued,bp->origmissings,n,capacity,capacity-n);
return(capacity);
}
@ -927,7 +927,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
}
else
{
if ( bp->hdrsi >= starti && bp->hdrsi < lasti && capacity > 0 )
if ( bp->hdrsi >= starti && bp->hdrsi < lasti )
capacity = iguana_bundlemissings(coin,bp,capacity,lag);
for (j=0; j<bp->n; j++)
{

3
iguana/iguana_recv.c

@ -1217,8 +1217,6 @@ int32_t iguana_processrecvQ(struct iguana_info *coin,int32_t *newhwmp) // single
*newhwmp = 0;
while ( coin->active != 0 && (req= queue_dequeue(&coin->recvQ,0)) != 0 )
{
if ( (flag % 100) == 50 )
iguana_reqblocks(coin);
flag++;
//fprintf(stderr,"flag.%d %s recvQ.%p type.%c n.%d\n",flag,req->addr != 0 ? req->addr->ipaddr : "0",req,req->type,req->n);
if ( req->type == 'B' ) // one block with all txdata
@ -1254,7 +1252,6 @@ int32_t iguana_processrecvQ(struct iguana_info *coin,int32_t *newhwmp) // single
if ( flag >= IGUANA_BUNDLELOOP )
break;
}
iguana_reqblocks(coin);
return(flag);
}

4
iguana/main.c

@ -344,7 +344,7 @@ mksquashfs DB/BTC BTC.squash1M -b 1048576
void mainloop(struct supernet_info *myinfo)
{
int32_t i,flag; struct iguana_info *coin; struct iguana_helper *ptr; struct iguana_bundle *bp;
int32_t i,flag; char str[65]; struct iguana_info *coin; struct iguana_helper *ptr; struct iguana_bundle *bp;
sleep(3);
printf("mainloop\n");
while ( 1 )
@ -358,6 +358,8 @@ void mainloop(struct supernet_info *myinfo)
//printf("main active.%d started.%p\n",coin->active,coin->started);
if ( coin->active != 0 && coin->started != 0 )
{
iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG);
iguana_reqblocks(coin);
coin->RTramchain_busy = 1;
if ( iguana_realtime_update(coin) > 0 )
flag++;

Loading…
Cancel
Save