From 6b4f180f765195fdd2494c42d247fc052717859e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Apr 2016 19:27:16 -0500 Subject: [PATCH] test --- iguana/iguana_bundles.c | 10 ++++++---- iguana/iguana_recv.c | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index c1723cb74..0be2f7f57 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -553,11 +553,11 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle iguana_bundleblock(coin,&hash2,bp,i); if ( bits256_nonz(hash2) != 0 ) { - if ( 0 && bp == coin->current ) - printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i); - if ( (addr= coin->peers.ranked[rand() % max]) != 0 && addr->usock >= 0 && addr->dead == 0 ) + if ( (addr= coin->peers.ranked[rand() % max]) != 0 && addr->usock >= 0 && addr->dead == 0 ) { struct iguana_blockreq *req = 0; + if ( bp == coin->current ) + printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i); if ( priority > 2 || bp->numsaved > bp->n-10 ) iguana_sendblockreqPT(coin,addr,bp,i,hash2,0); else @@ -583,13 +583,15 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle { if ( (addr= coin->peers.ranked[rand() % max]) != 0 && addr->usock >= 0 && addr->dead == 0 ) { + if ( bp == coin->current ) + printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i); n++; iguana_sendblockreqPT(coin,addr,bp,firsti,hash2,0); } } } } - if ( n > 0 && bp != coin->current ) + if ( n > 0 || bp == coin->current ) printf("issue.[%d] %d priority.%d\n",bp->hdrsi,n,priority); return(n); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index fdae02a50..08913a40d 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -695,9 +695,11 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl if ( prevbp->hdrsi+1 == coin->bundlescount && prevbundlei == coin->chain->bundlesize-1 ) { printf("AUTOCREATE.%d\n",prevbp->bundleheight + coin->chain->bundlesize); - bp = iguana_bundlecreate(coin,bundleip,prevbp->bundleheight + coin->chain->bundlesize,hash2,zero,0); - if ( bp->queued == 0 ) - iguana_bundleQ(coin,bp,1000); + if ( (bp= iguana_bundlecreate(coin,bundleip,prevbp->bundleheight + coin->chain->bundlesize,hash2,zero,0)) != 0 ) + { + if ( bp->queued == 0 ) + iguana_bundleQ(coin,bp,1000); + } } if ( prevbundlei < coin->chain->bundlesize-1 ) {