Skip to content

Commit

Permalink
Add missing RocksDB table locks for rep_weights table
Browse files Browse the repository at this point in the history
  • Loading branch information
simpago committed Mar 12, 2024
1 parent f016d62 commit eec74af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nano/node/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,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 ();
Expand Down
4 changes: 2 additions & 2 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion nano/test_common/testutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eec74af

Please sign in to comment.