aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-02-08 18:29:03 +0200
committerRiccardo Spagni <ric@spagni.net>2016-02-08 18:29:03 +0200
commitc1378881efa0bacc5673b66634f7661af11672a2 (patch)
tree5499b3d2f4b5bdbf098841bfacd3d2cf77401485 /src
parentMerge pull request #638 (diff)
parentunit_tests: fix hard fork unit tests and add a test for major too (diff)
downloadmonero-c1378881efa0bacc5673b66634f7661af11672a2.tar.xz
Merge pull request #639
119eb10 unit_tests: fix hard fork unit tests and add a test for major too (moneromooo-monero) 64a2aa3 hardfork: allow passing chain height in get(height) for convenience (moneromooo-monero)
Diffstat (limited to 'src')
-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);
}