aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/hardfork.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-08 20:58:06 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-08 20:58:06 +0000
commit759383c52dfe91f60c61dbba83046411c753b2eb (patch)
tree129bccbb205ca065ea6e446f52bb19b84d0caea6 /src/cryptonote_core/hardfork.cpp
parentblockchain: initialize m_hardfork to NULL (diff)
downloadmonero-759383c52dfe91f60c61dbba83046411c753b2eb.tar.xz
hardfork: add a default fork entry for v1 if none exist
To avoid special cases
Diffstat (limited to 'src/cryptonote_core/hardfork.cpp')
-rw-r--r--src/cryptonote_core/hardfork.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index 9fe731ad1..e99736ff4 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -155,6 +155,11 @@ bool HardFork::add(const cryptonote::block &block, uint64_t height)
void HardFork::init()
{
CRITICAL_REGION_LOCAL(lock);
+
+ // add a placeholder for the default version, to avoid special cases
+ if (heights.empty())
+ heights.push_back(Params(original_version, 0, 0, 0));
+
versions.clear();
for (size_t n = 0; n < 256; ++n)
last_versions[n] = 0;