1
0
Fork 0
forked from lthn/blockchain

total number of HFs + "==" and "!=" for hard_forks_descriptor

This commit is contained in:
sowle 2023-06-03 04:03:35 +02:00
parent 5230d062c8
commit 2aa302f69a
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 12 additions and 1 deletions

View file

@ -13,7 +13,7 @@ namespace currency
{
struct hard_forks_descriptor
{
constexpr static size_t m_total_count = 5;
constexpr static size_t m_total_count = ZANO_HARDFORKS_TOTAL;
std::array<uint64_t, m_total_count> m_height_the_hardfork_n_active_after;
hard_forks_descriptor()
@ -81,6 +81,16 @@ namespace currency
{
return HF3_BLOCK_MINOR_VERSION;
}
bool operator==(const hard_forks_descriptor& rhs) const
{
return m_height_the_hardfork_n_active_after == rhs.m_height_the_hardfork_n_active_after;
}
bool operator!=(const hard_forks_descriptor& rhs) const
{
return ! operator==(rhs);
}
};

View file

@ -266,6 +266,7 @@
#define ZANO_HARDFORK_02 2
#define ZANO_HARDFORK_03 3
#define ZANO_HARDFORK_04_ZARCANUM 4
#define ZANO_HARDFORKS_TOTAL 5