From 63766275301f1c562205e22d5f14b220f321ad58 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 21 Oct 2015 19:18:00 +0100 Subject: 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. --- tests/unit_tests/hardfork.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3