From 968d43f9aad4d0c1c18bcb47364bc87ee05f7024 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 17 Aug 2016 23:52:28 -0300 Subject: [PATCH] test --- gecko/gecko.c | 8 ++++---- iguana/iguana777.c | 7 +------ iguana/iguana_recv.c | 24 ++++++++++++++++++++++-- iguana/iguana_unspents.c | 6 +++--- iguana/main.c | 2 +- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/gecko/gecko.c b/gecko/gecko.c index 1b6fb5754..871cd63a5 100755 --- a/gecko/gecko.c +++ b/gecko/gecko.c @@ -47,10 +47,10 @@ void gecko_iteration(struct supernet_info *myinfo,struct iguana_info *btcd,struc longesthdrsi = virt->longestchain / virt->chain->bundlesize; if ( (bp= virt->bundles[hwmhdrsi]) != 0 ) { - iguana_RTspendvectors(myinfo,virt,bp); - iguana_RTramchainalloc("RTbundle",virt,bp); - iguana_update_balances(virt); - iguana_realtime_update(myinfo,virt); + //iguana_RTspendvectors(myinfo,virt,bp); + //iguana_RTramchainalloc("RTbundle",virt,bp); + //iguana_update_balances(virt); + //iguana_realtime_update(myinfo,virt); } if ( 0 && hwmhdrsi <= longesthdrsi )//&& virt->blocks.hwmchain.height < virt->longestchain-1 ) { diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 0a8e94b67..87a0d70bf 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -402,7 +402,6 @@ int32_t iguana_helperB(struct iguana_info *coin,int32_t helperid,struct iguana_b //if ( bp != coin->current ) { iguana_ramchain_prefetch(coin,&bp->ramchain,7); - printf("convert.%d [%d]\n",convertflag,bp->hdrsi); if ( convertflag == 0 ) { bp->converted = 1; @@ -543,11 +542,7 @@ int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int coin->spendvectorsaved = (uint32_t)time(NULL); coin->spendvalidated = 0; printf("%s UTXOGEN spendvectorsaved <- %u\n",coin->symbol,coin->spendvectorsaved); - if ( iguana_utxoaddr_gen(myinfo,coin,(coin->bundlescount - 1) * coin->chain->bundlesize) < 0 ) - { - printf("call again \n"); - iguana_utxoaddr_gen(myinfo,coin,(coin->bundlescount - 1) * coin->chain->bundlesize); - } + iguana_utxoaddr_gen(myinfo,coin,(coin->bundlescount - 1) * coin->chain->bundlesize); } else { diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index de059258c..001011491 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -552,7 +552,7 @@ void iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,struct void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bits256 *blockhashes,int32_t n) { - struct iguana_bundlereq *req; int32_t i,num; + struct iguana_bundlereq *req; int32_t i,num,j,flag; struct iguana_bundle *bp; if ( addr != 0 ) { addr->recvhdrs++; @@ -576,7 +576,27 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi if ( coin->RTheight > 0 ) { for (i=1; icurrent) != 0 ) + { + for (j=0; jn; j++) + { + if ( j < bp->numspec && bp->speculative != 0 && bits256_cmp(bp->speculative[j],blockhashes[i]) == 0 ) + { + flag = 1; + break; + } + if ( bits256_cmp(bp->hashes[j],blockhashes[i]) == 0 ) + { + flag = 1; + break; + } + } + } + if ( flag == 0 ) + iguana_sendblockreqPT(coin,addr,0,-1,blockhashes[i],0); + } } else if ( n > coin->chain->bundlesize ) iguana_sendblockreqPT(coin,addr,0,-1,blockhashes[1],0); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index ffafcaf42..e968c3aef 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1122,7 +1122,7 @@ int32_t iguana_utxoaddr_check(struct supernet_info *myinfo,struct iguana_info *c } good++; if ( ((good + bad) % 1000) == 0 ) - printf("%s utxoaddr validate good.%d bad.%d\n",coin->symbol,good,bad); + printf("%s utxoaddr validate good.%d bad.%d | (if this is taking too long, just exit and restart iguana)\n",coin->symbol,good,bad); return(0); } @@ -1161,8 +1161,8 @@ int32_t iguana_utxoaddr_validate(struct supernet_info *myinfo,struct iguana_info iguana_rwutxoaddr(0,ind,item,&UA); errs += iguana_utxoaddr_check(myinfo,coin,lastheight,unspents,max,&UA); total++; - if ( (total % 1000) == 0 ) - fprintf(stderr,"."); + //if ( (total % 1000) == 0 ) + // fprintf(stderr,"."); } } } diff --git a/iguana/main.c b/iguana/main.c index 9a938220d..c59f1c760 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -408,7 +408,7 @@ void mainloop(struct supernet_info *myinfo) //portable_mutex_lock(&myinfo->allcoins_mutex); HASH_ITER(hh,myinfo->allcoins,coin,tmp) { - if ( coin->current != 0 && coin->active != 0 && coin->started != 0 ) + if ( coin->RTheight == 0 && coin->current != 0 && coin->active != 0 && coin->started != 0 ) { isRT *= coin->isRT; if ( coin->peers != 0 )