Only enable min-difficulty blocks on testnet from a particular height

The min-difficulty change is a bilateral consensus rule change, and so
must be conditionally enabled in order for the earlier section of the
chain to synchronise.

Technically this could be implemented as a network upgrade, but as this will
never be deployed to mainnet, a targeted fork will suffice.
This commit is contained in:
Jack Grigg
2018-10-04 14:05:27 +01:00
parent 1702a86455
commit b86dc98047
4 changed files with 11 additions and 7 deletions

View File

@@ -8,6 +8,8 @@
#include "uint256.h"
#include <boost/optional.hpp>
namespace Consensus {
/**
@@ -91,7 +93,7 @@ struct Params {
NetworkUpgrade vUpgrades[MAX_NETWORK_UPGRADES];
/** Proof of work parameters */
uint256 powLimit;
bool fPowAllowMinDifficultyBlocks;
boost::optional<uint32_t> nPowAllowMinDifficultyBlocksFromHeight;
int64_t nPowAveragingWindow;
int64_t nPowMaxAdjustDown;
int64_t nPowMaxAdjustUp;