From 91aa90fc7914d9ece44ff6179f126ae2e5ba848b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 27 Jul 2017 18:18:49 +0100 Subject: [PATCH] blockchain: ensure all blocks get their longhash precalculated If the number of blocks to check was not a multiple of the number of preparation threads, the last few blocks would not be included in the threaded long hash calculation. Those would still get calculated when the block gets added to the chain, however, so this was only a tiny performance hit, rather than a security bug. --- src/cryptonote_core/blockchain.cpp | 4 +++- src/cryptonote_core/blockchain.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 742e1ac3..1313f914 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3743,9 +3743,11 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list &blocks, + void block_longhash_worker(uint64_t height, const std::vector &blocks, std::unordered_map &map) const; /**