Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
5e0454bbbe
  1. 4
      iguana/iguana_bundles.c
  2. 10
      iguana/iguana_recv.c

4
iguana/iguana_bundles.c

@ -618,7 +618,7 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle
return(0);
starti = coin->current == 0 ? 0 : coin->current->hdrsi;
lasti = coin->lastpending == 0 ? starti+coin->MAXBUNDLES : coin->lastpending->hdrsi;
if ( bp->hdrsi < starti || bp->hdrsi > lasti || bp->emitfinish != 0 || ((priority > 0 || bp == coin->current) && time(NULL) < bp->missingstime+3) || time(NULL) < bp->missingstime+30 )
if ( bp->hdrsi < starti || bp->hdrsi > lasti || bp->emitfinish != 0 || ((priority > 0 || bp == coin->current) && time(NULL) < bp->missingstime+3) )
return(0);
bp->missingstime = (uint32_t)time(NULL);
if ( bp->durationscount != 0 )
@ -1107,7 +1107,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin
iguana_bundlecalcs(coin,bp,lag);
if ( coin->blockdepth == 0 && coin->blockdepth == 0 && bp->hdrsi == coin->bundlescount-1 )
iguana_autoextend(coin,bp);
//if ( 0 && bp->hdrsi == 0 )
if ( 0 && bp->hdrsi == 0 )
printf("ITER utxo.%u now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->utxofinish,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
bp->nexttime = (uint32_t)time(NULL) + ((bp->hdrsi > starti) ? 0 : -2);
if ( bp->hdrsi == coin->bundlescount-1 || (bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize) )

10
iguana/iguana_recv.c

@ -69,14 +69,14 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
addr = coin->peers->ranked[rand() % n];
if ( addr == 0 || addr->pendblocks > coin->MAXPENDINGREQUESTS )
return(0);
if ( addr->usock < 0 )
return(0);
if ( memcmp(lastreq.bytes,hash2.bytes,sizeof(hash2)) == 0 || memcmp(lastreq2.bytes,hash2.bytes,sizeof(hash2)) == 0 )
{
//printf("duplicate req %s or null addr.%p\n",bits256_str(hexstr,hash2),addr);
printf("duplicate req %s or null addr.%p\n",bits256_str(hexstr,hash2),addr);
if ( iamthreadsafe == 0 && (rand() % 10) != 0 )
return(0);
}
if ( addr->usock < 0 )
return(0);
checkbp = 0, j = -2;
if ( (checkbp= iguana_bundlefind(coin,&checkbp,&j,hash2)) != 0 && j >= 0 && j < checkbp->n )
{
@ -86,7 +86,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
recvlen = numtx = 0;
if ( coin->RTheight > 0 && iguana_RTrawdata(coin,hash2,0,&recvlen,&numtx,1) != 0 )
{
//printf("found valid [%d:%d] in blockreqPT\n",checkbp->hdrsi,j);
printf("found valid [%d:%d] in blockreqPT\n",checkbp->hdrsi,j);
return(0);
} //else printf("no RTrawdata for %s\n",bits256_str(str,hash2));
}
@ -126,7 +126,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
bp->issued[bundlei] = addr->pendtime;
if ( block != 0 )
block->issued = addr->pendtime;
if ( 0 && coin->current == bp )
//if ( 0 && coin->current == bp )
printf("REQ.(%s) [%d:%d] %s n.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1,addr->ipaddr,addr->pendblocks);
} else printf("MSG_BLOCK null datalen.%d\n",len);
return(len);

Loading…
Cancel
Save