@@ -4141,44 +4141,22 @@ void DumpMempool(void)
4141
4141
}
4142
4142
}
4143
4143
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
-
4154
4144
// ! 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 )
4157
4147
return 0.0 ;
4158
4148
4159
4149
int64_t nNow = time (NULL );
4160
4150
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 ;
4166
4152
4167
4153
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 ;
4173
4155
} 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 ;
4179
4157
}
4180
4158
4181
- return fWorkBefore / ( fWorkBefore + fWorkAfter ) ;
4159
+ return pindex-> nChainTx / fTxTotal ;
4182
4160
}
4183
4161
4184
4162
class CMainCleanup
0 commit comments