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:
parent
c8b6debc43
commit
f220b45019
2 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -14,6 +14,8 @@ enum class writer
|
|||
confirmation_height,
|
||||
process_batch,
|
||||
pruning,
|
||||
voting,
|
||||
voting_final,
|
||||
testing // Used in tests to emulate a write lock
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue