jl777 9 years ago
parent
commit
061a4f3d46
  1. 12
      iguana/iguana_spendvectors.c

12
iguana/iguana_spendvectors.c

@ -615,13 +615,15 @@ void iguana_truncatebalances(struct iguana_info *coin)
int32_t iguana_volatilesinit(struct supernet_info *myinfo,struct iguana_info *coin) int32_t iguana_volatilesinit(struct supernet_info *myinfo,struct iguana_info *coin)
{ {
bits256 balancehash,allbundles; struct iguana_utxo *Uptr; struct iguana_account *Aptr; bits256 balancehash,allbundles; struct iguana_utxo *Uptr; struct iguana_account *Aptr;
struct sha256_vstate vstate,bstate; int32_t i,from_ro,numpkinds,numunspents; struct iguana_bundle *bp; struct iguana_block *block; struct sha256_vstate vstate,bstate; int32_t i,n,from_ro,numpkinds,numunspents; struct iguana_bundle *bp; struct iguana_block *block;
uint32_t crc,filecrc; FILE *fp; char crcfname[512],str[65],str2[65],buf[2048]; uint32_t crc,filecrc; FILE *fp; char crcfname[512],str[65],str2[65],buf[2048];
from_ro = 1; from_ro = 1;
for (i=0; i<coin->bundlescount; i++) for (i=n=0; i<coin->bundlescount; i++)
{ {
if ( (bp= coin->bundles[i]) == 0 ) if ( (bp= coin->bundles[i]) == 0 )
continue; continue;
if ( bp->utxofinish > 1 )
n++;
if ( bp->utxofinish <= 1 || (i > 0 && bp->utxofinish <= 1) ) if ( bp->utxofinish <= 1 || (i > 0 && bp->utxofinish <= 1) )
{ {
//printf("hdrsi.[%d] emitfinish.%u utxofinish.%u\n",i,bp->emitfinish,bp->utxofinish); //printf("hdrsi.[%d] emitfinish.%u utxofinish.%u\n",i,bp->emitfinish,bp->utxofinish);
@ -634,10 +636,10 @@ int32_t iguana_volatilesinit(struct supernet_info *myinfo,struct iguana_info *co
from_ro = 0; from_ro = 0;
} }
} }
printf("i.%d volatilesinit\n",i); printf("n.%d bundlescount.%d volatilesinit %d vs %d\n",n,i,(coin->longestchain-coin->chain->minconfirms)/coin->chain->bundlesize,n);
if ( (coin->longestchain-coin->chain->minconfirms)/coin->chain->bundlesize >= coin->bundlescount ) if ( (coin->longestchain-coin->chain->minconfirms)/coin->chain->bundlesize >= n )
{ {
printf("SKIP checking volatile files %d > %d\n",coin->longestchain,coin->bundlescount*coin->chain->bundlesize-coin->chain->minconfirms); printf("SKIP checking volatile files %d >= %d\n",(coin->longestchain-coin->chain->minconfirms)/coin->chain->bundlesize,n);
iguana_bundlestats(myinfo,coin,buf,IGUANA_DEFAULTLAG); iguana_bundlestats(myinfo,coin,buf,IGUANA_DEFAULTLAG);
return(coin->bundlescount); return(coin->bundlescount);
} }

Loading…
Cancel
Save