mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Merge pull request #1556 from darcys22/enforce-atomic-registrations-hf19
enforce atomic registrations in HF19
This commit is contained in:
commit
34a550b41f
1 changed files with 7 additions and 5 deletions
|
@ -352,18 +352,20 @@ namespace service_nodes
|
|||
{
|
||||
if (reg.uses_portions)
|
||||
{
|
||||
if (hf_version > hf::hf19_reward_batching)
|
||||
throw invalid_registration{"Portion-based registrations are not permitted after HF19"};
|
||||
if (hf_version >= hf::hf19_reward_batching)
|
||||
throw invalid_registration{"Portion-based registrations are not permitted in HF19+"};
|
||||
}
|
||||
else
|
||||
{
|
||||
// If not using portions then the hf value must be >= 19 and equal to the current blockchain hf:
|
||||
if (hf_version < hf::hf19_reward_batching || reg.hf != static_cast<uint8_t>(hf_version))
|
||||
throw invalid_registration{"Wrong registration hardfork " +
|
||||
std::to_string(reg.hf) + ", != current " + std::to_string(static_cast<uint8_t>(hf_version))};
|
||||
throw invalid_registration{fmt::format(
|
||||
"Wrong registration hardfork {}; you likely need to regenerate "
|
||||
"the registration for compatibility with hardfork {}",
|
||||
reg.hf, static_cast<uint8_t>(hf_version))};
|
||||
}
|
||||
|
||||
const size_t max_contributors = (hf_version >= hf::hf19_reward_batching && !reg.uses_portions)
|
||||
const size_t max_contributors = hf_version >= hf::hf19_reward_batching
|
||||
? oxen::MAX_CONTRIBUTORS_HF19
|
||||
: oxen::MAX_CONTRIBUTORS_V1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue