Don't limit min difficulty on testnet

This commit is contained in:
SChernykh 2023-01-16 18:34:48 +01:00
parent f206e4b334
commit fe5e209eb1

View file

@ -2018,7 +2018,7 @@ bool SideChain::load_config(const std::string& filename)
parseValue(doc, "block_time", m_targetBlockTime);
uint64_t min_diff;
if (parseValue(doc, "min_diff", min_diff)) {
if (parseValue(doc, "min_diff", min_diff) && min_diff) {
m_minDifficulty = { min_diff, 0 };
}
@ -2050,6 +2050,7 @@ bool SideChain::check_config() const
return false;
}
if (s_networkType == NetworkType::Mainnet) {
const difficulty_type min_diff{ MIN_DIFFICULTY, 0 };
const difficulty_type max_diff{ 1000000000, 0 };
@ -2057,6 +2058,7 @@ bool SideChain::check_config() const
LOGERR(1, "min_diff is invalid (must be between " << min_diff << " and " << max_diff << ')');
return false;
}
}
if ((m_chainWindowSize < 60) || (m_chainWindowSize > 2160)) {
LOGERR(1, "pplns_window is invalid (must be between 60 and 2160)");