aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/hardfork.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-12 19:19:25 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-12 20:32:23 +0100
commit7e4e0021f422eec55fb0417b1d6e86ceddc1934f (patch)
tree62d2516871b61424612f8b6f5bd5dc52d3345a42 /src/cryptonote_core/hardfork.cpp
parentMerge pull request #955 (diff)
downloadmonero-7e4e0021f422eec55fb0417b1d6e86ceddc1934f.tar.xz
daemon: print time to next fork
Diffstat (limited to 'src/cryptonote_core/hardfork.cpp')
-rw-r--r--src/cryptonote_core/hardfork.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index 39c026b08..c63ca36ef 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -369,6 +369,18 @@ uint64_t HardFork::get_earliest_ideal_height_for_version(uint8_t version) const
return 0;
}
+uint8_t HardFork::get_next_version() const
+{
+ CRITICAL_REGION_LOCAL(lock);
+ uint64_t height = db.height();
+ for (unsigned int n = heights.size() - 1; n > 0; --n) {
+ if (height >= heights[n].height) {
+ return heights[n < heights.size() - 1 ? n + 1 : n].version;
+ }
+ }
+ return original_version;
+}
+
bool HardFork::get_voting_info(uint8_t version, uint32_t &window, uint32_t &votes, uint32_t &threshold, uint64_t &earliest_height, uint8_t &voting) const
{
CRITICAL_REGION_LOCAL(lock);