diff --git a/iguana/confs/BTCD_hdrs.h b/iguana/confs/BTCD_hdrs.h index 45f6ff412..e186c6846 100644 --- a/iguana/confs/BTCD_hdrs.h +++ b/iguana/confs/BTCD_hdrs.h @@ -2101,5 +2101,19 @@ char *BTCD_hdrs[][4] = { { "1049500", "450bc6a5f1b7d502c9a86ecb08ed3bf26c87149f6b6242deebf998ec1190dacb", "e496811cc6cab5c2b821d21ba29b71ca4256b228889e352e779a82aeea96df63", "64fd7f1d78833ec1260e9b39249e9957207845d99bab950ef921a3a5fafdda46"}, { "1050000", "a835e80973ca0240c06703a30433a139d200453a7296c24a22b62792d17ff2a1", "44c9a74b2ad97727ae4f419a77804a88f9a3cb31bb3ae65e2b372040c1eb273e", "95c578d836ef48bd93f58757d6c3b093acaa373f9654410f85dae1aefdd5d3fc"}, { "1050500", "631b74a56a6719158926aca09aa8ab8cd89b61e563a5b6386ec6de5e782e926a", "1e1c4fc04badc617cc382d6aadde8ae735277694e233a225634e2be077c97a2a", "fd4f6efdea193b035f4b5947404483b6930997bf8089d1661d9b9ef48c9887aa"}, -{ "1051000", "1ec8fcfb9b6d6c602e2775686f04f1d39a768064ee6aeb65930bfee5b1a94e19", "4f2f38f9f74bfd1ea8daf0ac5ffa8afb485436d5e4b35fd0742c454439b21488", "f6311a3834e71c30635c01e0c45aacfcb2241780e3aa13f2c834a84f5afda969"} +{ "1051000", "1ec8fcfb9b6d6c602e2775686f04f1d39a768064ee6aeb65930bfee5b1a94e19", "4f2f38f9f74bfd1ea8daf0ac5ffa8afb485436d5e4b35fd0742c454439b21488", "f6311a3834e71c30635c01e0c45aacfcb2241780e3aa13f2c834a84f5afda969"}, +{ "1051500", "73133e5c1408263f8053ed9a93ae7164dffc2381d3a7fa24cc78c29665b3bf39", "a47a6e2a98fef063017953ee09b4471622b986b7fe8dc6d52adda451db9c852e", "fb14519af510b672ace64d3d250549fad14d1ed623dd0544bc541b7e3710e38b"}, +{ "1052000", "20e08cce79f51cc9e5b0dd212f6cc3a0ad742244e58ce252600d286fe2415cc3", "edcb3b3a1aff133bac74770612727bf2f15cfafab7c63dfbfe6f2378debda004", "d47a434a2ba0524ee99b5664f66792b81fc9134f5ceb00e69efdf9a46f8142f4"}, +{ "1052500", "37e19650eba3eb3e2967c2585147cc37714d24ac681a8b78d11f946ceca3c083", "069c1246cc4290b4748b26b30446f3a7aae4ca9bd847d0f1be6a8dd07e89d52e", "dd01920c16ffd5ab35e7d670ff88cfc9bf348f0c85238643b8f04a2919978c7a"}, +{ "1053000", "8a22777c8f3ee2b71fc33926cde2363be651b56f4886962d9aebf6e111ef4af5", "2789aab47bf324a74e8ba9fe94951e5b3e8caa995f93f1c01a9e6f4e95783bc8", "0b4d50b5fc9dd327976276cce10c407e52b7fb70cf03d233ed3e88dcd1d8d4c1"}, +{ "1053500", "693b78182f2e9dfbf138a54fe519285ca8b5665dd630b9651d63010208cf1250", "efd0a291bdd8f0928a31f4083021b5daf1fc5de4f7b1ccdf70b2c7f62c80c5c9", "9800ab253ae43ff7d243ba35495517747e70d7da20a4a0d4691808ed669a95ca"}, +{ "1054000", "7d052ca1210218d7316d2d9b82c15e8e57d59ac3d444fdd45dbf5e577f9b4c69", "bee8ff913f9b231c0b34a55bf2381184d18389d43b1f6719227fd4d5c80d8b60", "fcd0429b0f95329e6c482907dad4a9e4733c8860c129ba977299d6dfbbe45cbe"}, +{ "1054500", "1b00ae5589d8eae631a21b715150b89a3786a33166cf0fb11e79f1c12b493e5b", "f8d95559f470788377237801e29369ebdd9b682ac289e43fc18ccb751ecbe29a", "1d1b84b14c6aead094be828f14e8d90bb451216f84ce7c325641b3277276ba7d"}, +{ "1055000", "6c92f01ed8c5f4247722230e045ae10ba6973c3f8d8ad66684852efdfd801234", "59fb8eb1e18d1ed445f7378eacd8b02e92698d99c1ac4d1544e35d127134424e", "527e64783b51c20f17908f8d4a5222f837061f839e5a35effaee8625110d96b7"}, +{ "1055500", "655d624dd686c5c3f95a7e48687d3cc7f7e3623b02c1f8db8727e54186e16cef", "508f0be15eadc58ee080897002ad681fc2fd2f4bd4e175a319807626603ed601", "2a01b2336eb82c2d66c72dfa96f1bb4778d0a28b7c169c431a8030ffcb18056b"}, +{ "1056000", "af11656c7cb4f7ff056efc8255205feb3ea12f96da9ac416e33b034e93241e42", "a9d081e5eb78f1018e0a86b8c2c333989d375adb3f217df5ce8fe0dbcf84c5d4", "6e3b76382e6e42804f19c5552c36c46ea24829dc035c16b0a138254a2c192aab"}, +{ "1056500", "4f7ce26131a4923137977f716334a07a99d1fede466564c89aac75415eea0eb3", "6723f6345fe576dcac1c5ccb5390321e317408c7dc34c4ddca7a6ac83c577ca1", "1649fcd866bf63938016938d91a53248bf9a50db3fe7af3711beec8fc3ac573f"}, +{ "1057000", "1fbe16214e11324f46064f3754e3189dc4e57e9aafe221ea7fa45627f0db2f2d", "123d5e7d330c6dc7cf7a4b9efc6375736de9b6acd14e75205e72513a19e938de", "c7dc8a859791fb06bc5de694f4586affa038b1b065ceb3abec61ef4e27dd3c3f"}, +{ "1057500", "2c742e483d8a978656e28a4b574fcac3264f040a569e8e141fb3b5f0de9585c7", "301d401df39b752d5e5a7c3d11b8dc6f985b7f836a4f8e4a318631c45d6d4f6f", "eb5eea8f78367516258e9e79be1c491b84899dbd73b9469c862b115088f44e89"}, +{ "1058000", "71060b474bbc2cccca3629b7a682061d4c6883c35750878c998c2946f99fc70e", "", ""}, }; diff --git a/iguana/iguana777.c b/iguana/iguana777.c index d41757a82..22cc46e86 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -399,16 +399,6 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert //printf("helperid.%d utxofinished.%d vs %d\n",helperid,n,max); sleep(3); } - for (hdrsi=helperid; hdrsibundles[hdrsi]) == 0 ) - return(-1); - if ( iguana_bundlevalidate(coin,bp,0) != bp->n ) - { - printf("validate.[%d] error. just refresh page or restart iguana\n",bp->hdrsi); - exit(-1); - } - } if ( convertflag == 0 ) { for (hdrsi=helperid; hdrsiorigbalanceswritten <= 1 ) hdrsi = 0; else hdrsi = coin->origbalanceswritten; - while ( (n= iguana_validated(coin)) < max ) + /*while ( (n= iguana_validated(coin)) < max ) { sleep(3); printf("validated.%d of %d\n",n,max); - } + }*/ for (; hdrsibalanceswritten++) { iguana_ramchain_prefetch(coin,&coin->bundles[hdrsi]->ramchain,0); - iguana_balancegen(coin,0,coin->bundles[hdrsi],0,coin->chain->bundlesize-1,0); + if ( iguana_balancegen(coin,0,coin->bundles[hdrsi],0,coin->chain->bundlesize-1,0) == 0 ) + bp->balancefinish = (uint32_t)time(NULL); } if ( iguana_balanceflush(coin,max) > 0 ) printf("balanceswritten.%d flushed bp->hdrsi %d vs %d coin->longestchain/coin->chain->bundlesize\n",coin->balanceswritten,bp->hdrsi,coin->longestchain/coin->chain->bundlesize); @@ -465,7 +456,16 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert //printf("helperid.%d waiting for spendvectorsaved.%u\n",helperid,coin->spendvectorsaved); sleep(3); } - printf("helper.%d finished utxogen\n",helperid); + for (hdrsi=helperid; hdrsibundles[hdrsi]) == 0 ) + return(-1); + if ( iguana_bundlevalidate(coin,bp,0) != bp->n ) + { + printf("validate.[%d] error. just refresh page or restart iguana\n",bp->hdrsi); + exit(-1); + } + } return(num); } diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index e331b703a..cea39c3d0 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -371,7 +371,7 @@ int32_t iguana_walkchain(struct iguana_info *coin,int32_t skipflag) height--; } } - printf("walk skip.%d n.%d hwm.%d %s\n",skipflag,n,coin->blocks.hwmchain.height,bits256_str(str,coin->blocks.hwmchain.RO.hash2)); + //printf("walk skip.%d n.%d hwm.%d %s\n",skipflag,n,coin->blocks.hwmchain.height,bits256_str(str,coin->blocks.hwmchain.RO.hash2)); return(n); } diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index 04f72b8d0..5ffffc3e2 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -497,7 +497,7 @@ struct iguana_info *iguana_coinstart(struct iguana_info *coin,int32_t initialhei for (j=0; jtmpspends != ramchain->Xspendinds && emit > 0 ) { - printf("spendvectors: RT [%d] numtmpspends.%d vs starti.%d emit.%d\n",bp->hdrsi,bp->numtmpspends,starti,emit); + // printf("spendvectors: RT [%d] numtmpspends.%d vs starti.%d emit.%d\n",bp->hdrsi,bp->numtmpspends,starti,emit); bp->tmpspends = myrealloc('x',bp->tmpspends,sizeof(*ptr)*bp->numtmpspends,sizeof(*ptr)*(bp->numtmpspends+emit)); memcpy(&bp->tmpspends[bp->numtmpspends],ptr,sizeof(*ptr)*emit); bp->numtmpspends += emit; @@ -1095,7 +1095,8 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st } if ( ptr != 0 ) myfree(ptr,sizeof(*ptr) * n); - printf("UTXO [%4d].%-6d dur.%-2d [milli %8.3f] vectors %-6d err.%d [%5.2f%%] %7d %9s of %d\n",bp->hdrsi,bp->numtmpspends,(uint32_t)time(NULL)-starttime,OS_milliseconds()-startmillis,spendind,errs,100.*(double)emitted/(total+1),emit,mbstr(str,sizeof(*ptr) * emit),n); + if ( bp != coin->current ) + printf("UTXO [%4d].%-6d dur.%-2d [milli %8.3f] vectors %-6d err.%d [%5.2f%%] %7d %9s of %d\n",bp->hdrsi,bp->numtmpspends,(uint32_t)time(NULL)-starttime,OS_milliseconds()-startmillis,spendind,errs,100.*(double)emitted/(total+1),emit,mbstr(str,sizeof(*ptr) * emit),n); if ( errs != 0 ) { printf("EXITING, restart iguana\n"); @@ -1131,7 +1132,8 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig txidind = B[starti].firsttxidind; spendind = B[starti].firstvin; emit = startemit; - fprintf(stderr,"BALANCEGEN.[%d] %p[%d] starti.%d s%d <-> endi.%d s%d startemit.%d\n",bp->hdrsi,Xspendinds,numXspends,starti,spendind,endi,B[endi].firstvin+B[endi].numvins,startemit); + if ( bp != coin->current ) + fprintf(stderr,"BALANCEGEN.[%d] %p[%d] starti.%d s%d <-> endi.%d s%d startemit.%d\n",bp->hdrsi,Xspendinds,numXspends,starti,spendind,endi,B[endi].firstvin+B[endi].numvins,startemit); for (i=starti; i<=endi; i++) { now = (uint32_t)time(NULL); @@ -1681,8 +1683,8 @@ void iguana_RTramchainfree(struct iguana_info *coin) coin->RTheight = coin->balanceswritten * coin->chain->bundlesize; coin->RTgenesis = 0; iguana_ramchain_free(coin,&coin->RTramchain,1); - iguana_mempurge(&coin->RTmem); - iguana_mempurge(&coin->RThashmem); + coin->RTmem.used = 0; + coin->RThashmem.used = 0; coin->RTdatabad = 0; } @@ -1738,6 +1740,7 @@ void iguana_RTramchainalloc(char *fname,struct iguana_info *coin,struct iguana_b if ( coin->RTramchain.H.data == 0 ) { printf("ALLOC RTramchain\n"); + iguana_RTramchainfree(coin); iguana_ramchainopen(fname,coin,dest,&coin->RTmem,&coin->RThashmem,bp->bundleheight,bp->hashes[0]); dest->H.txidind = dest->H.unspentind = dest->H.spendind = dest->pkind = dest->H.data->firsti; dest->externalind = dest->H.stacksize = 0; @@ -1827,12 +1830,13 @@ int32_t iguana_realtime_update(struct iguana_info *coin) double startmillis0; static double totalmillis0; static int32_t num0; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata; int32_t bundlei,i,n,flag=0; bits256 hash2; struct iguana_peer *addr; struct iguana_block *block=0; struct iguana_blockRO *B; struct iguana_ramchain *dest=0,blockR; - if ( coin->RTdatabad != 0 ) + bp = coin->current; + if ( bp != 0 && coin->RTdatabad != 0 ) { iguana_RTramchainfree(coin); iguana_RTramchainalloc("RTbundle",coin,bp); } - if ( (bp= coin->current) != 0 && bp->hdrsi == coin->longestchain/coin->chain->bundlesize && bp->hdrsi == coin->balanceswritten && coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n && ((coin->RTheight <= coin->blocks.hwmchain.height && time(NULL) > bp->lastRT) || time(NULL) > bp->lastRT+10) ) + if ( bp != 0 && bp->hdrsi == coin->longestchain/coin->chain->bundlesize && bp->hdrsi == coin->balanceswritten && coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n && ((coin->RTheight <= coin->blocks.hwmchain.height && time(NULL) > bp->lastRT) || time(NULL) > bp->lastRT+10) ) { if ( (block= bp->blocks[0]) == 0 || block->txvalid == 0 || block->mainchain == 0 ) { @@ -1927,7 +1931,7 @@ int32_t iguana_realtime_update(struct iguana_info *coin) n = 0; if ( dest != 0 && flag != 0 && coin->RTheight >= coin->longestchain ) { - printf("ramchainiterate.[%d] ave %.2f micros, total %.2f seconds starti.%d num.%d\n",num0,(totalmillis0*1000.)/num0,totalmillis0/1000.,coin->RTstarti,coin->RTheight%bp->n); + //printf("ramchainiterate.[%d] ave %.2f micros, total %.2f seconds starti.%d num.%d\n",num0,(totalmillis0*1000.)/num0,totalmillis0/1000.,coin->RTstarti,coin->RTheight%bp->n); if ( (n= iguana_walkchain(coin,1)) == coin->RTheight-1 ) { //printf("RTgenesis verified\n"); @@ -1955,7 +1959,8 @@ int32_t iguana_realtime_update(struct iguana_info *coin) int32_t iguana_bundlevalidate(struct iguana_info *coin,struct iguana_bundle *bp,int32_t forceflag) { static int32_t totalerrs,totalvalidated; - FILE *fp; char fname[1024]; uint8_t *blockspace; int32_t i,max,len,errs = 0; int64_t total = 0; + FILE *fp; char fname[1024]; uint8_t *blockspace; uint32_t now = (uint32_t)time(NULL); + int32_t i,max,len,errs = 0; int64_t total = 0; if ( bp->validated <= 1 || forceflag != 0 ) { sprintf(fname,"%s/%s/validated/%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight); @@ -1988,7 +1993,7 @@ int32_t iguana_bundlevalidate(struct iguana_info *coin,struct iguana_bundle *bp, } free(blockspace); bp->validated = (uint32_t)time(NULL); - printf("VALIDATED.[%d] errs.%d total.%lld %u | total errs.%d validated.%d\n",bp->bundleheight,errs,(long long)total,bp->validated,totalerrs,totalvalidated); + printf("VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d\n",bp->hdrsi,bp->bundleheight,bp->validated - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated); } if ( errs == 0 && fp == 0 ) {