core: move hardforks into its own lib

So it can be used by others without encumbrance
This commit is contained in:
moneromooo-monero
2019-01-21 12:18:39 +00:00
parent 2c171a9b02
commit d0663837d2
10 changed files with 220 additions and 144 deletions

View File

@@ -87,7 +87,7 @@ bool HardFork::add_fork(uint8_t version, uint64_t height, uint8_t threshold, tim
}
if (threshold > 100)
return false;
heights.push_back(Params(version, height, threshold, time));
heights.push_back(hardfork_t(version, height, threshold, time));
return true;
}
@@ -171,7 +171,7 @@ void HardFork::init()
// add a placeholder for the default version, to avoid special cases
if (heights.empty())
heights.push_back(Params(original_version, 0, 0, 0));
heights.push_back(hardfork_t(original_version, 0, 0, 0));
versions.clear();
for (size_t n = 0; n < 256; ++n)