Change vote_generator to use write_queue when acquiring db transaction.

Previously the vote_generator was not respecting the write_queue.
This commit is contained in:
Colin LeMahieu 2024-04-13 11:40:52 +01:00
commit f220b45019
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
2 changed files with 3 additions and 0 deletions

View file

@ -94,6 +94,7 @@ void nano::vote_generator::process_batch (std::deque<queue_entry_t> & batch)
{
std::deque<candidate_t> 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)

View file

@ -14,6 +14,8 @@ enum class writer
confirmation_height,
process_batch,
pruning,
voting,
voting_final,
testing // Used in tests to emulate a write lock
};