diff --git a/nano/node/vote_generator.cpp b/nano/node/vote_generator.cpp index addc7219..c5cac3b7 100644 --- a/nano/node/vote_generator.cpp +++ b/nano/node/vote_generator.cpp @@ -94,6 +94,7 @@ void nano::vote_generator::process_batch (std::deque & batch) { std::deque candidates_new; { + auto guard = ledger.store.write_queue.wait (is_final ? nano::store::writer::voting_final : nano::store::writer::voting); auto transaction = ledger.store.tx_begin_write ({ tables::final_votes }); for (auto & [root, hash] : batch) diff --git a/nano/store/write_queue.hpp b/nano/store/write_queue.hpp index 674a7742..e01a6bf3 100644 --- a/nano/store/write_queue.hpp +++ b/nano/store/write_queue.hpp @@ -14,6 +14,8 @@ enum class writer confirmation_height, process_batch, pruning, + voting, + voting_final, testing // Used in tests to emulate a write lock };