Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
03f559bffc
  1. 2
      iguana/iguana_bundles.c
  2. 13
      iguana/iguana_recv.c

2
iguana/iguana_bundles.c

@ -597,6 +597,8 @@ int32_t iguana_bundleready(struct iguana_info *coin,struct iguana_bundle *bp)
void iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle *bp,uint8_t *missings)
{
int32_t i,tmp,tmp2,priority = 3; bits256 hash2; double aveduration;
if ( bp->emitfinish != 0 )
return;
if ( bp->durationscount != 0 )
aveduration = (double)bp->totaldurations / bp->durationscount;
else aveduration = IGUANA_DEFAULTLAG/3 + 1;

13
iguana/iguana_recv.c

@ -70,7 +70,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
checkbp = 0, j = -2;
if ( (checkbp= iguana_bundlefind(coin,&checkbp,&j,hash2)) != 0 && j >= 0 && j < checkbp->n )
{
if ( checkbp->emitfinish != 0 || ((block= checkbp->blocks[j]) != 0 && block->txvalid != 0) )
if ( checkbp->emitfinish != 0 || (block= checkbp->blocks[j]) != 0 )//&& block->txvalid != 0) )
{
//printf("found valid [%d:%d] in blockreqPT\n",checkbp->hdrsi,j);
return(0);
@ -78,10 +78,13 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
}
if ( 1 && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 )
{
//printf("found valid [%d:%d] in blockreqPT\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1);
return(0);
if ( block != 0 && block->hdrsi != 0 && block->bundlei != 0 )
{
printf("found valid [%d:%d] in blockreqPT txvalid.%d\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1,block->txvalid);
if ( block->txvalid != 0 )
return(0);
}
}
if ( addr->msgcounts.verack == 0 )
{
//printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
@ -209,7 +212,7 @@ int32_t iguana_speculativefind(struct iguana_info *coin,struct iguana_bundle *bp
{
if ( memcmp(&recvlen,tmp,sizeof(recvlen)) != 0 || memcmp(&tmp[sizeof(recvlen)],data,recvlen) != 0 )
printf("ERROR ");
if ( bp == coin->current )
if ( 0 && bp == coin->current )
printf("[%d:%d] already has recvlen.%d for %s\n",bp->hdrsi,i,recvlen,bits256_str(str,block->RO.hash2));
return(0);
}

Loading…
Cancel
Save