aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/hardfork.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-24 20:46:10 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-24 20:47:12 +0000
commitd887c18e333aefb74b168931f23edcaf21b642d9 (patch)
tree408beeb28a97ed335bce2cb8406188926f7349e9 /src/cryptonote_core/hardfork.h
parenthardfork: fix rescan on load (diff)
downloadmonero-d887c18e333aefb74b168931f23edcaf21b642d9.tar.xz
hardfork: fix more major/minor issues
Also add some more tests, and rename some instances of "version" and "add" for clarity. NOTE: the starting height values are sometimes wrong. I suspect this is due to the hard fork reorg code being buggy, since they're good when syncing after the fact. However, they're not actually used by the consensus code, so I'm ignoring this for now, but this needs debugging.
Diffstat (limited to 'src/cryptonote_core/hardfork.h')
-rw-r--r--src/cryptonote_core/hardfork.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cryptonote_core/hardfork.h b/src/cryptonote_core/hardfork.h
index 6800749da..6d2a3c55b 100644
--- a/src/cryptonote_core/hardfork.h
+++ b/src/cryptonote_core/hardfork.h
@@ -71,7 +71,7 @@ namespace cryptonote
* @param threshold The threshold of votes needed for this fork (0-100)
* @param time Approximate time of the hardfork (seconds since epoch)
*/
- bool add(uint8_t version, uint64_t height, uint8_t threshold, time_t time);
+ bool add_fork(uint8_t version, uint64_t height, uint8_t threshold, time_t time);
/**
* @brief add a new hardfork height
@@ -79,10 +79,11 @@ namespace cryptonote
* returns true if no error, false otherwise
*
* @param version the major block version for the fork
+ * @param voting_version the minor block version for the fork, used for voting
* @param height The height the hardfork takes effect
* @param time Approximate time of the hardfork (seconds since epoch)
*/
- bool add(uint8_t version, uint64_t height, time_t time);
+ bool add_fork(uint8_t version, uint64_t height, time_t time);
/**
* @brief initialize the object
@@ -203,10 +204,10 @@ namespace cryptonote
private:
uint8_t get_block_version(uint64_t height) const;
- bool do_check(uint8_t version) const;
+ bool do_check(uint8_t block_version, uint8_t voting_version) const;
int get_voted_fork_index(uint64_t height) const;
- uint8_t get_effective_version(uint8_t version) const;
- bool add(uint8_t block_version, uint64_t height);
+ uint8_t get_effective_version(uint8_t voting_version) const;
+ bool add(uint8_t block_version, uint8_t voting_version, uint64_t height);
bool rescan_from_block_height(uint64_t height);
bool rescan_from_chain_height(uint64_t height);