From 3e24e16eb6ea28fea9e7a03b5abd76622ae2f991 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 26 Mar 2016 01:49:55 -0300 Subject: [PATCH] test --- iguana/SuperNET.c | 1 + iguana/iguana_bundles.c | 9 +++++++-- iguana/iguana_recv.c | 1 + iguana/main.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 64ebd198c..95d3854f1 100755 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -788,6 +788,7 @@ char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *de if ( method != 0 && strcmp(method,"stop") == 0 ) { addr->dead = (uint32_t)time(NULL); + addr->rank = 0; free_json(json); if ( ptr != 0 ) free(ptr); diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index e4525826f..a4aeb458f 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -500,7 +500,10 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int if ( peercounts[i] > threshold && (addr= coin->peers.ranked[i]) != 0 && now > bp->currenttime+lag && addr->dead == 0 ) { if ( (numpeers > 64 || addr->laggard++ > 13) && coin->current == bp ) + { addr->dead = (uint32_t)time(NULL); + addr->rank = 0; + } for (j=0; jn; j++) { if ( (block= bp->blocks[j]) != 0 && block->peerid == i && block->fpipbits == 0 ) @@ -545,7 +548,9 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int iguana_blockQ("kicka",coin,bp,i,block->RO.hash2,forceflag); if ( forceflag != 0 && (addr= coin->peers.ranked[rand() % numpeers]) != 0 ) iguana_sendblockreqPT(coin,addr,bp,i,block->RO.hash2,0); - } else iguana_blockQ("kickb",coin,bp,i,block->RO.hash2,0); + } + else if ( forceflag != 0 ) + iguana_blockQ("kickb",coin,bp,i,block->RO.hash2,0); if ( forceflag != 0 ) bp->issued[i] = block->issued = now; else bp->issued[i] = block->issued = saved; @@ -785,7 +790,7 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp) //#ifdef IGUANA_SERIALIZE_SPENDVECTORGEN //if ( coin->MAXMEM <= 4*(1024L * 1024 * 1024) ) { - if ( (prevbp= coin->current) != 0 && prevbp->hdrsi < (coin->longestchain / coin->chain->bundlesize)-coin->MAXBUNDLES ) + if ( (prevbp= coin->current) != 0 && prevbp->hdrsi < (coin->longestchain / coin->chain->bundlesize)-0*coin->MAXBUNDLES ) return(0); } //#endif diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 63ed306c5..295a820bc 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -527,6 +527,7 @@ void iguana_checklongestchain(struct iguana_info *coin,struct iguana_bundle *bp, { printf("blacklist addr.(%s) height %d\n",addr->ipaddr,addr->height); addr->dead = 1; + addr->rank = 0; } } } diff --git a/iguana/main.c b/iguana/main.c index 313b75020..7e72f26c4 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1132,7 +1132,7 @@ void iguana_main(void *arg) sleep(1); char *str; //iguana_launchcoin(MYINFO.rpcsymbol,cJSON_Parse("{}")); - if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"startpend\":2048,\"endpend\":2048,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":129,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0)) != 0 ) + if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"startpend\":128,\"endpend\":128,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":129,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0)) != 0 ) { free(str); if ( 0 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0)) != 0 )