mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 16:02:24 +00:00
hardfork: remove use of GNU extension for initializing object
This commit is contained in:
parent
4bbf944df0
commit
fec98b8952
2 changed files with 5 additions and 4 deletions
|
@ -64,7 +64,7 @@ bool HardFork::add(uint8_t version, uint64_t height, time_t time)
|
||||||
if (time <= heights.back().time)
|
if (time <= heights.back().time)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
heights.push_back({version: version, height: height, time: time});
|
heights.push_back(Params(version, height, time));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ HardFork::State HardFork::get_state() const
|
||||||
uint8_t HardFork::get(uint64_t height) const
|
uint8_t HardFork::get(uint64_t height) const
|
||||||
{
|
{
|
||||||
CRITICAL_REGION_LOCAL(lock);
|
CRITICAL_REGION_LOCAL(lock);
|
||||||
if (height > db.height()) {
|
if (height >= db.height()) {
|
||||||
assert(false);
|
assert(false);
|
||||||
return 255;
|
return 255;
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,11 +197,12 @@ namespace cryptonote
|
||||||
|
|
||||||
uint8_t original_version;
|
uint8_t original_version;
|
||||||
|
|
||||||
typedef struct {
|
struct Params {
|
||||||
uint8_t version;
|
uint8_t version;
|
||||||
uint64_t height;
|
uint64_t height;
|
||||||
time_t time;
|
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::vector<Params> heights;
|
||||||
|
|
||||||
std::deque<uint8_t> versions; /* rolling window of the last N blocks' versions */
|
std::deque<uint8_t> versions; /* rolling window of the last N blocks' versions */
|
||||||
|
|
Loading…
Reference in a new issue