Merge pull request #6776

ab1f560 Support -checkmempool=N, which runs checks on average once every N transactions (Pieter Wuille)
This commit is contained in:
Pieter Wuille
2015-10-28 02:24:44 +01:00
3 changed files with 12 additions and 6 deletions

View File

@@ -278,7 +278,7 @@ public:
class CTxMemPool
{
private:
bool fSanityCheck; //! Normally false, true if -checkmempool or -regtest
uint32_t nCheckFrequency; //! Value n means that n times in 2^32 we check.
unsigned int nTransactionsUpdated;
CBlockPolicyEstimator* minerPolicyEstimator;
@@ -360,7 +360,7 @@ public:
* check does nothing.
*/
void check(const CCoinsViewCache *pcoins) const;
void setSanityCheck(bool _fSanityCheck) { fSanityCheck = _fSanityCheck; }
void setSanityCheck(double dFrequency = 1.0) { nCheckFrequency = dFrequency * 4294967296.0; }
// addUnchecked must updated state for all ancestors of a given transaction,
// to track size/count of descendant transactions. First version of