aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/hardfork.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-01-14 22:41:14 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-01-14 22:41:14 +0000
commitfeb499aaae496361f0b96a76ab614dca5258a5c1 (patch)
tree0325227a5d79bfb8ca1d498af491a8e064ecd681 /src/cryptonote_core/hardfork.h
parentMerge pull request #1566 (diff)
downloadmonero-feb499aaae496361f0b96a76ab614dca5258a5c1.tar.xz
core: check block version for alt chains too
This is incompatible with block version voting
Diffstat (limited to 'src/cryptonote_core/hardfork.h')
-rw-r--r--src/cryptonote_core/hardfork.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cryptonote_core/hardfork.h b/src/cryptonote_core/hardfork.h
index 33b958f9c..8d2edfa2a 100644
--- a/src/cryptonote_core/hardfork.h
+++ b/src/cryptonote_core/hardfork.h
@@ -114,6 +114,20 @@ namespace cryptonote
bool check(const cryptonote::block &block) const;
/**
+ * @brief same as check, but for a particular height, rather than the top
+ *
+ * NOTE: this does not play well with voting, and relies on voting to be
+ * disabled (that is, forks happen on the scheduled date, whether or not
+ * enough blocks have voted for the fork).
+ *
+ * returns true if no error, false otherwise
+ *
+ * @param block the new block
+ * @param height which height to check for
+ */
+ bool check_for_height(const cryptonote::block &block, uint64_t height) const;
+
+ /**
* @brief add a new block
*
* returns true if no error, false otherwise
@@ -211,6 +225,7 @@ namespace cryptonote
uint8_t get_block_version(uint64_t height) const;
bool do_check(uint8_t block_version, uint8_t voting_version) const;
+ bool do_check_for_height(uint8_t block_version, uint8_t voting_version, uint64_t height) const;
int get_voted_fork_index(uint64_t height) const;
uint8_t get_effective_version(uint8_t voting_version) const;
bool add(uint8_t block_version, uint8_t voting_version, uint64_t height);