Add missing RocksDB table locks for rep_weights table

This commit is contained in:
Gustav Schauwecker 2024-03-12 14:49:45 +01:00
commit f99ba3e852
3 changed files with 4 additions and 4 deletions

View file

@ -282,7 +282,7 @@ auto nano::block_processor::process_batch (nano::unique_lock<nano::mutex> & lock
processed_batch_t processed;
auto scoped_write_guard = write_database_queue.wait (nano::writer::process_batch);
auto transaction (node.store.tx_begin_write ({ tables::accounts, tables::blocks, tables::frontiers, tables::pending }));
auto transaction (node.store.tx_begin_write ({ tables::accounts, tables::blocks, tables::frontiers, tables::pending, tables::rep_weights }));
nano::timer<std::chrono::milliseconds> timer_l;
lock_a.lock ();

View file

@ -354,7 +354,7 @@ nano::node::node (boost::asio::io_context & io_ctx_a, std::filesystem::path cons
if (!is_initialized && !flags.read_only)
{
auto const transaction (store.tx_begin_write ({ tables::accounts, tables::blocks, tables::confirmation_height, tables::frontiers }));
auto const transaction (store.tx_begin_write ({ tables::accounts, tables::blocks, tables::confirmation_height, tables::frontiers, tables::rep_weights }));
// Store was empty meaning we just created it, add the genesis block
store.initialize (transaction, ledger.cache, ledger.constants);
}
@ -558,7 +558,7 @@ void nano::node::process_active (std::shared_ptr<nano::block> const & incoming)
nano::block_status nano::node::process (std::shared_ptr<nano::block> block)
{
auto const transaction = store.tx_begin_write ({ tables::accounts, tables::blocks, tables::frontiers, tables::pending });
auto const transaction = store.tx_begin_write ({ tables::accounts, tables::blocks, tables::frontiers, tables::pending, tables::rep_weights });
return process (transaction, block);
}

View file

@ -63,7 +63,7 @@ nano::account nano::test::random_account ()
bool nano::test::process (nano::node & node, std::vector<std::shared_ptr<nano::block>> blocks)
{
auto const transaction = node.store.tx_begin_write ({ tables::accounts, tables::blocks, tables::frontiers, tables::pending });
auto const transaction = node.store.tx_begin_write ({ tables::accounts, tables::blocks, tables::frontiers, tables::pending, tables::rep_weights });
for (auto & block : blocks)
{
auto result = node.process (transaction, block);