aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-11-11 11:08:47 +0200
committerRiccardo Spagni <ric@spagni.net>2015-11-11 11:08:54 +0200
commitea7380aa7f3906be6f319044e6ce1d207d1ae576 (patch)
treed18eed234c70ae166640d0de21a956ec74f6263e /src/cryptonote_core/blockchain.cpp
parentMerge pull request #475 (diff)
parenthardfork: add a get_ideal_version(uint64_t) function (diff)
downloadmonero-ea7380aa7f3906be6f319044e6ce1d207d1ae576.tar.xz
Merge pull request #481
2f254ff hardfork: add a get_ideal_version(uint64_t) function (moneromooo-monero) 4187e56 hardfork: allow per-fork voting thresholds (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index d115d3bd5..49443e0e2 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -72,23 +72,25 @@ DISABLE_VS_WARNINGS(4267)
static const struct {
uint8_t version;
uint64_t height;
+ uint8_t threshold;
time_t time;
} mainnet_hard_forks[] = {
// version 1 from the start of the blockchain
- { 1, 1, 1341378000 },
+ { 1, 1, 0, 1341378000 },
- // version 2 can start from block 1009827, setup on the 20th of september
- { 2, 1009827, 1442763710 },
+ // version 2 can start from block 1009827, setup on the 20th of september. No vote.
+ { 2, 1009827, 0, 1442763710 },
};
static const uint64_t mainnet_hard_fork_version_1_till = 750000;
static const struct {
uint8_t version;
uint64_t height;
+ uint8_t threshold;
time_t time;
} testnet_hard_forks[] = {
// version 1 from the start of the blockchain
- { 1, 1, 1341378000 },
+ { 1, 1, 0, 1341378000 },
};
static const uint64_t testnet_hard_fork_version_1_till = 540000;
@@ -252,13 +254,13 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet)
if (testnet) {
m_hardfork = new HardFork(*db, 1, testnet_hard_fork_version_1_till);
for (size_t n = 0; n < sizeof(testnet_hard_forks) / sizeof(testnet_hard_forks[0]); ++n)
- m_hardfork->add(testnet_hard_forks[n].version, testnet_hard_forks[n].height, testnet_hard_forks[n].time);
+ m_hardfork->add(testnet_hard_forks[n].version, testnet_hard_forks[n].height, testnet_hard_forks[n].threshold, testnet_hard_forks[n].time);
}
else
{
m_hardfork = new HardFork(*db, 1, mainnet_hard_fork_version_1_till);
for (size_t n = 0; n < sizeof(mainnet_hard_forks) / sizeof(mainnet_hard_forks[0]); ++n)
- m_hardfork->add(mainnet_hard_forks[n].version, mainnet_hard_forks[n].height, mainnet_hard_forks[n].time);
+ m_hardfork->add(mainnet_hard_forks[n].version, mainnet_hard_forks[n].height, mainnet_hard_forks[n].threshold, mainnet_hard_forks[n].time);
}
m_hardfork->init();