diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-21 19:18:00 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-21 19:21:14 +0100 |
commit | 63766275301f1c562205e22d5f14b220f321ad58 (patch) | |
tree | 687f1d48cd6e6dcba3b6c3445b5ddabecdf89a6f /tests/unit_tests/hardfork.cpp | |
parent | unit_tests: remove leftover debug traces in hardfork test (diff) | |
download | monero-63766275301f1c562205e22d5f14b220f321ad58.tar.xz |
hardfork: switch voting to block minor version
Using major version would cause older daemons to reject those
blocks as they fail to deserialize blocks with a major version
which is not 1. There is no such restriction on the minor
version, so switching allows older daemons to coexist with
newer ones till the actual fork date, when most will hopefully
have updated already.
Also, for the same reason, we consider a vote for 0 to be a
vote for 1, since older daemons set minor version to 0.
Diffstat (limited to 'tests/unit_tests/hardfork.cpp')
-rw-r--r-- | tests/unit_tests/hardfork.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/unit_tests/hardfork.cpp b/tests/unit_tests/hardfork.cpp index a8d2d381f..210c1959b 100644 --- a/tests/unit_tests/hardfork.cpp +++ b/tests/unit_tests/hardfork.cpp @@ -131,7 +131,7 @@ private: static cryptonote::block mkblock(uint8_t version) { cryptonote::block b; - b.major_version = version; + b.minor_version = version; return b; } @@ -358,7 +358,6 @@ TEST(new_blocks, denied) ASSERT_TRUE(hf.add(2, 2, 1)); hf.init(); - ASSERT_FALSE(hf.add(mkblock(0), 0)); ASSERT_TRUE(hf.add(mkblock(1), 0)); ASSERT_TRUE(hf.add(mkblock(1), 1)); ASSERT_TRUE(hf.add(mkblock(1), 2)); @@ -384,7 +383,6 @@ TEST(new_version, early) ASSERT_TRUE(hf.add(2, 4, 1)); hf.init(); - ASSERT_FALSE(hf.add(mkblock(0), 0)); ASSERT_TRUE(hf.add(mkblock(2), 0)); ASSERT_TRUE(hf.add(mkblock(2), 1)); // we have enough votes already ASSERT_TRUE(hf.add(mkblock(2), 2)); @@ -417,7 +415,6 @@ TEST(reorganize, changed) #define ADD_TRUE(v, h) ADD(v, h, TRUE) #define ADD_FALSE(v, h) ADD(v, h, FALSE) - ADD_FALSE(0, 0); ADD_TRUE(1, 0); ADD_TRUE(1, 1); ADD_TRUE(2, 2); |