aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-09-26 14:06:00 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-09-27 22:46:36 +0100
commitfec98b8952f10424cf41e3d21ad1fc2d9ad84d83 (patch)
tree04b7c3f781ae7f34b66175faba77cd613446b8bb
parentblockchain: on hardfork 2, allow miners to claim less money than allowed (diff)
downloadmonero-fec98b8952f10424cf41e3d21ad1fc2d9ad84d83.tar.xz
hardfork: remove use of GNU extension for initializing object
-rw-r--r--src/cryptonote_core/hardfork.cpp4
-rw-r--r--src/cryptonote_core/hardfork.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index f4df1f9c6..30c5d94c9 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -64,7 +64,7 @@ bool HardFork::add(uint8_t version, uint64_t height, time_t time)
if (time <= heights.back().time)
return false;
}
- heights.push_back({version: version, height: height, time: time});
+ heights.push_back(Params(version, height, time));
return true;
}
@@ -239,7 +239,7 @@ 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;
}
diff --git a/src/cryptonote_core/hardfork.h b/src/cryptonote_core/hardfork.h
index bdac87f2c..946e5febc 100644
--- a/src/cryptonote_core/hardfork.h
+++ b/src/cryptonote_core/hardfork.h
@@ -197,11 +197,12 @@ namespace cryptonote
uint8_t original_version;
- typedef struct {
+ struct Params {
uint8_t version;
uint64_t height;
time_t time;
- } Params;
+ Params(uint8_t version, uint64_t height, time_t time): version(version), height(height), time(time) {}
+ };
std::vector<Params> heights;
std::deque<uint8_t> versions; /* rolling window of the last N blocks' versions */