Account for the average candidate multiplier in EstimateCandidatePrimeProbability().

The estimate seems to match the observed block rate more closely on testnet now.
master
Mikael Hirki 2013-08-01 00:56:56 +03:00
parent 8fd6738dfe
commit abd1c37bc4
1 changed files with 2 additions and 1 deletions

View File

@ -1185,5 +1185,6 @@ double EstimateCandidatePrimeProbability(unsigned int nPrimorialMultiplier)
// true, but nontheless it's a reasonable model of the chances of finding
// prime chains.
const unsigned int nSieveWeaveOptimalPrime = vPrimes[(unsigned int) ((uint64) nSievePercentage * vPrimes.size() / 100)];
return (1.781072 * log((double)std::max(1u, nSieveWeaveOptimalPrime)) / (256.0 * log(2.0) + (double) nPrimorialMultiplier));
const unsigned int nAverageCandidateMultiplier = nSieveSize / 2;
return (1.781072 * log((double)std::max(1u, nSieveWeaveOptimalPrime)) / (256.0 * log(2.0) + (double) nPrimorialMultiplier + log(nAverageCandidateMultiplier)));
}