@@ -4141,44 +4141,22 @@ void DumpMempool(void)
41414141 }
41424142}
41434143
4144- /* *
4145- * How many times slower we expect checking transactions after the last
4146- * checkpoint to be (from checking signatures, which is skipped up to the
4147- * last checkpoint). This number is a compromise, as it can't be accurate
4148- * for every system. When reindexing from a fast disk with a slow CPU, it
4149- * can be up to 20, while when downloading from a slow network with a
4150- * fast multicore CPU, it won't be much higher than 1.
4151- */
4152- static const double SIGCHECK_VERIFICATION_FACTOR = 5.0 ;
4153-
41544144// ! Guess how far we are in the verification process at the given block index
4155- double GuessVerificationProgress (const ChainTxData& data, CBlockIndex *pindex, bool fSigchecks ) {
4156- if (pindex== NULL )
4145+ double GuessVerificationProgress (const ChainTxData& data, CBlockIndex *pindex) {
4146+ if (pindex == NULL )
41574147 return 0.0 ;
41584148
41594149 int64_t nNow = time (NULL );
41604150
4161- double fSigcheckVerificationFactor = fSigchecks ? SIGCHECK_VERIFICATION_FACTOR : 1.0 ;
4162- double fWorkBefore = 0.0 ; // Amount of work done before pindex
4163- double fWorkAfter = 0.0 ; // Amount of work left after pindex (estimated)
4164- // Work is defined as: 1.0 per transaction before the last checkpoint, and
4165- // fSigcheckVerificationFactor per transaction after.
4151+ double fTxTotal ;
41664152
41674153 if (pindex->nChainTx <= data.nTransactionsLastCheckpoint ) {
4168- double nCheapBefore = pindex->nChainTx ;
4169- double nCheapAfter = data.nTransactionsLastCheckpoint - pindex->nChainTx ;
4170- double nExpensiveAfter = (nNow - data.nTimeLastCheckpoint )/86400.0 *data.fTransactionsPerDay ;
4171- fWorkBefore = nCheapBefore;
4172- fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor ;
4154+ fTxTotal = data.nTransactionsLastCheckpoint + (nNow - data.nTimeLastCheckpoint ) / 86400.0 * data.fTransactionsPerDay ;
41734155 } else {
4174- double nCheapBefore = data.nTransactionsLastCheckpoint ;
4175- double nExpensiveBefore = pindex->nChainTx - data.nTransactionsLastCheckpoint ;
4176- double nExpensiveAfter = (nNow - pindex->GetBlockTime ())/86400.0 *data.fTransactionsPerDay ;
4177- fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor ;
4178- fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor ;
4156+ fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime ()) / 86400.0 * data.fTransactionsPerDay ;
41794157 }
41804158
4181- return fWorkBefore / ( fWorkBefore + fWorkAfter ) ;
4159+ return pindex-> nChainTx / fTxTotal ;
41824160}
41834161
41844162class CMainCleanup
0 commit comments