diff --git a/iguana/iguana777.h b/iguana/iguana777.h index c1682a4f0..64beb0b42 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -38,8 +38,8 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_MAXPENDHDRS 1 #define _IGUANA_MAXPENDING 3 -#define IGUANA_MINPENDBUNDLES 8 -#define IGUANA_MAXPENDBUNDLES 64 +#define IGUANA_MINPENDBUNDLES 4 +#define IGUANA_MAXPENDBUNDLES 128 #define IGUANA_BUNDLELOOP 77 #define IGUANA_RPCPORT 7778 #define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index bc723d0d4..d8c1826d6 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -466,7 +466,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int { if ( peercounts[i] > 10 && (addr= coin->peers.ranked[i]) != 0 && now > bp->currenttime+lag ) { - if ( numpeers > 64 || addr->laggard++ > 5 ) + if ( numpeers > 64 || addr->laggard++ > 3 ) addr->dead = (uint32_t)time(NULL); for (j=0; jn; j++) { diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 0e190668a..ed3b11ef6 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -836,24 +836,30 @@ int32_t iguana_reqblocks(struct iguana_info *coin) { coin->backstop = coin->blocks.hwmchain.height+1; hash2 = iguana_blockhash(coin,coin->backstop); + bp = coin->bundles[(coin->blocks.hwmchain.height+1)/coin->chain->bundlesize]; + bundlei = (coin->blocks.hwmchain.height+1) % coin->chain->bundlesize; + if ( bits256_nonz(hash2) == 0 ) + { + hash2 = bp->hashes[bundlei]; + if ( bits256_nonz(hash2) == 0 && bp->speculative != 0 ) + hash2 = bp->speculative[bundlei]; + } if ( bits256_nonz(hash2) > 0 ) { - bp = coin->bundles[(coin->blocks.hwmchain.height+1)/coin->chain->bundlesize]; - bundlei = (coin->blocks.hwmchain.height+1) % coin->chain->bundlesize; - if ( bp != 0 && bits256_nonz(bp->hashes[bundlei]) > 0 ) + if ( bp != 0 && bits256_nonz(hash2) > 0 ) { coin->backstopmillis = OS_milliseconds(); - iguana_blockQ("mainchain",coin,bp,bundlei,bp->hashes[bundlei],0); + iguana_blockQ("mainchain",coin,bp,bundlei,hash2,0); flag++; char str[65]; if ( 1 && (rand() % 1000) == 0 || bp->bundleheight > coin->longestchain-coin->chain->bundlesize ) printf("%s MAINCHAIN.%d threshold %.3f %.3f lag %.3f\n",bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,coin->backstopmillis,lag); } - else if ( bp != 0 && bundlei < bp->n-1 && bits256_nonz(bp->hashes[bundlei+1]) > 0 ) - { - printf("MAINCHAIN skip issue %d\n",bundlei+1); - iguana_blockQ("mainskip",coin,bp,bundlei,bp->hashes[bundlei+1],0); - } + } + else if ( bp != 0 && bundlei < bp->n-1 && bits256_nonz(bp->hashes[bundlei+1]) > 0 ) + { + printf("MAINCHAIN skip issue %d\n",bundlei+1); + iguana_blockQ("mainskip",coin,bp,bundlei,bp->hashes[bundlei+1],0); } } } diff --git a/iguana/main.c b/iguana/main.c index 9dc7749bb..6cc7710cc 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -325,7 +325,7 @@ void sigcontinue_func() { printf("\nSIGCONT\n"); signal(SIGCONT,sigcontinue_func void mainloop(struct supernet_info *myinfo) { - int32_t i,flag; struct iguana_info *coin; struct iguana_bundle *bp; struct iguana_helper *ptr; + int32_t i,flag; struct iguana_info *coin; struct iguana_helper *ptr; sleep(3); printf("mainloop\n"); while ( 1 )