Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
142414a93b
  1. 10
      iguana/iguana_bundles.c
  2. 8
      iguana/iguana_recv.c

10
iguana/iguana_bundles.c

@ -563,7 +563,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
void iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int32_t timelimit)
{
int32_t i,n; uint32_t now; struct iguana_block *block; double endmillis = OS_milliseconds() + timelimit;
printf("ITERATE bundle.%d r.%d s.%d\n",bp->bundleheight,bp->numrecv,bp->numsaved);
printf("ITERATE bundle.%d r.%d s.%d finished.%d\n",bp->bundleheight,bp->numrecv,bp->numsaved,bp->emitfinish);
memset(bp->issued,0,sizeof(bp->issued));
while ( bp->emitfinish == 0 && OS_milliseconds() < endmillis )
{
@ -574,7 +574,7 @@ void iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int32_
{
if ( block->queued == 0 && block->fpipbits == 0 && bp->issued[i] == 0 )
{
printf("(%d:%d) ",bp->hdrsi,i);
//printf("(%d:%d) ",bp->hdrsi,i);
iguana_blockQ(coin,bp,i,block->RO.hash2,0);
bp->issued[i] = now;
}
@ -583,14 +583,14 @@ void iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int32_
} else printf("iguana_bundleiters[%d] unexpected null block[%d]\n",bp->bundleheight,i);
bp->numsaved = n;
}
usleep(1000);
}
if ( bp->numsaved >= bp->n && bp->emitfinish == 0 )
{
printf(">>>>>>>>>>>>>>>>>>>>>>> EMIT\n");
printf(">>>>>>>>>>>>>>>>>>>>>>> EMIT bundle.%d\n",bp->bundleheight);
bp->emitfinish = 1;
iguana_emitQ(coin,bp);
return;
}
usleep(1000);
}
iguana_bundleQ(coin,bp,timelimit);
}

8
iguana/iguana_recv.c

@ -45,7 +45,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
coin->numreqsent++;
addr->pendblocks++;
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);
return(len);
}
@ -466,9 +466,9 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
if ( bp != 0 && bp->hdrsi == coin->bundlescount-1 )
{
if ( block != 0 && (next= block->hh.next) != 0 )
iguana_blockQ(coin,bp,bundlei+1,next->RO.hash2,0), printf("AUTONEXT ");
iguana_blockQ(coin,bp,bundlei+1,next->RO.hash2,0), printf("AUTONEXT %d\n",block->height+1);
}
static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
//static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
iguana_bundlefind(coin,&prevbp,&prevbundlei,origblock->RO.prev_block);
if ( prevbp != 0 && prevbundlei >= 0 && (prevblock= iguana_blockfind(coin,origblock->RO.prev_block)) != 0 )
{
@ -749,7 +749,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
block = 0;
if ( priority == 0 && (bp= req->bp) != 0 && req->bundlei >= 0 && req->bundlei < bp->n && req->bundlei < coin->chain->bundlesize && (block= bp->blocks[req->bundlei]) != 0 && (block->fpipbits != 0 || block->queued != 0) )
{
//if ( 0 && priority != 0 )
if ( 1 && priority != 0 )
printf("SKIP %p[%d] %d\n",bp,bp!=0?bp->bundleheight:-1,req->bundlei);
}
else

Loading…
Cancel
Save