Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
ec464ff753
  1. 12
      iguana/iguana777.c
  2. 10
      iguana/iguana_recv.c

12
iguana/iguana777.c

@ -384,7 +384,7 @@ void iguana_coinloop(void *arg)
printf("after bundlecreate\n");//, getchar();
while ( 1 )
{
fprintf(stderr,"iter\n");
//fprintf(stderr,"iter\n");
flag = 0;
for (i=0; i<n; i++)
{
@ -405,7 +405,7 @@ void iguana_coinloop(void *arg)
{
if ( coin->peers.numranked < 8 && now > coin->lastpossible+60 )
{
fprintf(stderr,"possible\n");
//fprintf(stderr,"possible\n");
coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers
}
}
@ -413,18 +413,18 @@ void iguana_coinloop(void *arg)
{
if ( coin->peers.numranked != 0 && coin->peers.numranked < (coin->MAXPEERS>>1) && now > coin->lastpossible+6 )
{
fprintf(stderr,"possible\n");
//fprintf(stderr,"possible\n");
coin->lastpossible = iguana_possible_peer(coin,0); // tries to connect to new peers
}
}
if ( now > coin->peers.lastmetrics+6 )
{
fprintf(stderr,"metrics\n");
//fprintf(stderr,"metrics\n");
coin->peers.lastmetrics = iguana_updatemetrics(coin); // ranks peers
}
fprintf(stderr,"call stats\n");
//fprintf(stderr,"call stats\n");
iguana_bundlestats(coin,str);
fprintf(stderr,"call process\n");
//fprintf(stderr,"call process\n");
flag += iguana_processrecv(coin);
}
}

10
iguana/iguana_recv.c

@ -650,7 +650,7 @@ int32_t iguana_processbundlesQ(struct iguana_info *coin,int32_t *newhwmp) // sin
*newhwmp = 0;
while ( flag < IGUANA_BUNDLELOOP && (req= queue_dequeue(&coin->bundlesQ,0)) != 0 )
{
fprintf(stderr,"%s bundlesQ.%p type.%c n.%d\n",req->addr != 0 ? req->addr->ipaddr : "0",req,req->type,req->n);
//fprintf(stderr,"%s bundlesQ.%p type.%c n.%d\n",req->addr != 0 ? req->addr->ipaddr : "0",req,req->type,req->n);
if ( req->type == 'B' ) // one block with all txdata
req = iguana_recvblock(coin,req->addr,req,&req->block,req->numtx,req->datalen,req->recvlen,newhwmp);
else if ( req->type == 'H' ) // blockhdrs (doesnt have txn_count!)
@ -1007,11 +1007,11 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
int32_t iguana_processrecv(struct iguana_info *coin) // single threaded
{
int32_t newhwm = 0,flag = 0;
fprintf(stderr,"process bundlesQ\n");
//fprintf(stderr,"process bundlesQ\n");
flag += iguana_processbundlesQ(coin,&newhwm);
fprintf(stderr,"iguana_reqhdrs\n");
flag += iguana_reqhdrs(coin);
fprintf(stderr,"iguana_reqblocks\n");
//fprintf(stderr,"iguana_reqhdrs\n");
//flag += iguana_reqhdrs(coin);
//fprintf(stderr,"iguana_reqblocks\n");
flag += iguana_reqblocks(coin);
return(flag);
}

Loading…
Cancel
Save