aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-01 20:06:17 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-01 20:06:55 +0000
commit64a2aa33764b5ef4fed3e13cdc07dc80594297f1 (patch)
tree11736db4e15ecf14b37bd0143bdc4ea2a29e3ec5 /src/cryptonote_core
parentMerge pull request #636 (diff)
downloadmonero-64a2aa33764b5ef4fed3e13cdc07dc80594297f1.tar.xz
hardfork: allow passing chain height in get(height) for convenience
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/hardfork.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index 66fb05010..9fe731ad1 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -318,10 +318,13 @@ HardFork::State HardFork::get_state() const
uint8_t HardFork::get(uint64_t height) const
{
CRITICAL_REGION_LOCAL(lock);
- if (height >= db.height()) {
+ if (height > db.height()) {
assert(false);
return 255;
}
+ if (height == db.height()) {
+ return get_current_version();
+ }
return db.get_hard_fork_version(height);
}