From 0949e005c1df921fd6f473cf1913047bdde1fdcb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 16 Aug 2016 11:31:20 -0300 Subject: [PATCH] test --- iguana/iguana_blocks.c | 10 +++++----- iguana/iguana_recv.c | 2 +- iguana/main.c | 4 ++-- includes/iguana_defines.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index ef47383a2..fdfffe915 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -531,7 +531,7 @@ void iguana_setchain(void *chainparms) struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_block *newblock) { - int32_t valid,bundlei,height=-1; struct iguana_block *hwmchain,*block = 0,*prev=0,*next; + int32_t valid,bundlei,height=-1; struct iguana_block *hwmchain,*block = 0,*prev=0; bits256 *hash2p=0; double prevPoW = 0.; struct iguana_bundle *bp; if ( newblock == 0 ) return(0); @@ -542,7 +542,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl if ( (block= iguana_blockfind("chainlink",coin,newblock->RO.hash2)) != 0 ) { if ( block->RO.timestamp == 0 ) - block->mainchain = block->valid = 0; + block->mainchain = block->valid = block->txvalid = 0; iguana_blocksizecheck("chainlink",coin->chain->zcash,block); if ( memcmp(coin->chain->genesis_hashdata,block->RO.hash2.bytes,sizeof(bits256)) == 0 ) block->PoW = PoW_from_compact(block->RO.bits,coin->chain->unitval), height = 0; @@ -554,13 +554,13 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl { prevPoW = prev->PoW; block->PoW = PoW_from_compact(block->RO.bits,coin->chain->unitval) + prevPoW; - if ( (next= prev->hh.next) != 0 ) + /*if ( (next= prev->hh.next) != 0 ) { if ( next->mainchain != 0 && block->PoW < next->PoW ) return(0); //printf("block->PoW %f next %f\n",block->PoW,next->PoW); hwmchain = next; - } + }*/ height = prev->height + 1; } else @@ -593,7 +593,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl // iguana_blockunmain(coin,prev->hh.next); prev->hh.next = block; } - if ( coin->isRT != 0 || block->height == hwmchain->height ) + if ( coin->isRT != 0 || block->height >= hwmchain->height ) { coin->blocks.maxblocks = (block->height + 1); //printf("[%s] <- ht.%d %f\n",bits256_str(str,block->RO.hash2),coin->blocks.hwmchain.height,coin->blocks.hwmchain.PoW); diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index b65b1fb6d..5d2dc5cf6 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -1676,12 +1676,12 @@ int32_t iguana_processrecv(struct supernet_info *myinfo,struct iguana_info *coin //iguana_utxoaddr_gen(myinfo,coin,(coin->balanceswritten - 1) * coin->chain->bundlesize); } flag += iguana_processrecvQ(coin,&newhwm); + flag += iguana_reqblocks(coin); //if ( coin->spendvectorsaved > 1 ) { if ( time(NULL) > coin->laststats+5 ) { flag += iguana_reqhdrs(coin); - flag += iguana_reqblocks(coin); iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG); coin->laststats = (uint32_t)time(NULL); } diff --git a/iguana/main.c b/iguana/main.c index 1a36bcb7c..6feb8941c 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -551,10 +551,10 @@ void iguana_appletests(struct supernet_info *myinfo) bitcoin_sharedsecret(myinfo->ctx,hash2,pubkey,33); printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i); getchar();**/ - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) { free(str); - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) + if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) { free(str); if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0,myinfo->rpcport)) != 0 ) diff --git a/includes/iguana_defines.h b/includes/iguana_defines.h index e4c846c90..0eeaebe81 100755 --- a/includes/iguana_defines.h +++ b/includes/iguana_defines.h @@ -78,7 +78,7 @@ struct iguana_txdatabits { uint64_t addrind:IGUANA_LOG2MAXPEERS,filecount:10,fpo #define IGUANA_DEDICATED_THREADS #ifdef IGUANA_DEDICATED_THREADS -#define IGUANA_MAXCONNTHREADS 16 +#define IGUANA_MAXCONNTHREADS 32 #define IGUANA_MAXSENDTHREADS (IGUANA_MAXPEERS>>2) #define IGUANA_MAXRECVTHREADS (IGUANA_MAXPEERS>>2) #else