From fead09cb1ef4701fe188bd00ebcfe68d9040f3b8 Mon Sep 17 00:00:00 2001 From: alfred <> Date: Fri, 8 Feb 2019 14:07:30 -0800 Subject: [PATCH 1/2] l-value assignement error --- tests/difficulty/difficulty.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/difficulty/difficulty.cpp b/tests/difficulty/difficulty.cpp index fc6133e6..5cc53014 100644 --- a/tests/difficulty/difficulty.cpp +++ b/tests/difficulty/difficulty.cpp @@ -35,9 +35,13 @@ int test_big_difficulties(const char* dataFile) end = n - DIFFICULTY_LAG; begin = end - DIFFICULTY_WINDOW; } + auto stamps = vector(timestamps.begin() + begin, timestamps.begin() + end); + auto cumulative_diffs = vector(cumulative_difficulties.begin() + begin, cumulative_difficulties.begin() + end); currency::wide_difficulty_type res = currency::next_difficulty( - vector(timestamps.begin() + begin, timestamps.begin() + end), - vector(cumulative_difficulties.begin() + begin, cumulative_difficulties.begin() + end), DEFAULT_TEST_DIFFICULTY_TARGET); + stamps, + cumulative_diffs, + DEFAULT_TEST_DIFFICULTY_TARGET + ); if (res != difficulty) { cerr << "Wrong wide difficulty for block " << n << endl << "Expected: " << difficulty << endl @@ -90,9 +94,13 @@ int main(int argc, char *argv[]) { << "Found: " << res << endl; return 1; } + auto stamps = vector(timestamps.begin() + begin, timestamps.begin() + end); + auto cumulative_diffs = vector(wide_cumulative_difficulties.begin() + begin, wide_cumulative_difficulties.begin() + end); currency::wide_difficulty_type wide_res = currency::next_difficulty( - vector(timestamps.begin() + begin, timestamps.begin() + end), - vector(wide_cumulative_difficulties.begin() + begin, wide_cumulative_difficulties.begin() + end), DEFAULT_TEST_DIFFICULTY_TARGET); + stamps, + cumulative_diffs, + DEFAULT_TEST_DIFFICULTY_TARGET + ); if (wide_res.convert_to() != res) { cerr << "Wrong wide difficulty for block " << n << endl << "Expected: " << res << endl @@ -110,3 +118,4 @@ int main(int argc, char *argv[]) { return 0; } + From a3da8ba81977d49509077af0d4ba616fdebaaafc Mon Sep 17 00:00:00 2001 From: alfred <> Date: Fri, 8 Feb 2019 14:08:25 -0800 Subject: [PATCH 2/2] wrong assignement --- src/currency_protocol/currency_protocol_handler.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index 119d234d..7fa2e80c 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -420,7 +420,7 @@ namespace currency total_blocks_parsing_time += block_parsing_time; //to avoid concurrency in core between connections, suspend connections which delivered block later then first one - if(count = 2) + if(count == 2) { if(m_core.have_block(get_block_hash(b))) {