mirror of
https://github.com/monero-project/monero.git
synced 2025-08-12 09:00:17 -04:00
core: check block version for alt chains too
This is incompatible with block version voting
This commit is contained in:
parent
d98db4868d
commit
feb499aaae
3 changed files with 36 additions and 0 deletions
|
@ -114,6 +114,19 @@ bool HardFork::check(const cryptonote::block &block) const
|
|||
return do_check(::get_block_version(block), ::get_block_vote(block));
|
||||
}
|
||||
|
||||
bool HardFork::do_check_for_height(uint8_t block_version, uint8_t voting_version, uint64_t height) const
|
||||
{
|
||||
int fork_index = get_voted_fork_index(height);
|
||||
return block_version == heights[fork_index].version
|
||||
&& voting_version >= heights[fork_index].version;
|
||||
}
|
||||
|
||||
bool HardFork::check_for_height(const cryptonote::block &block, uint64_t height) const
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(lock);
|
||||
return do_check_for_height(::get_block_version(block), ::get_block_vote(block), height);
|
||||
}
|
||||
|
||||
bool HardFork::add(uint8_t block_version, uint8_t voting_version, uint64_t height)
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue