From 1a8277ce6e2566c6104c8cd3c22ea5da2abae96d Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Wed, 30 Oct 2024 08:01:40 +0100 Subject: [PATCH] fix locks --- .../consensus/src/pillar_chain/pillar_chain_manager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/core_libs/consensus/src/pillar_chain/pillar_chain_manager.cpp b/libraries/core_libs/consensus/src/pillar_chain/pillar_chain_manager.cpp index bd8257b977..932ad31a08 100644 --- a/libraries/core_libs/consensus/src/pillar_chain/pillar_chain_manager.cpp +++ b/libraries/core_libs/consensus/src/pillar_chain/pillar_chain_manager.cpp @@ -108,9 +108,8 @@ std::shared_ptr PillarChainManager::createPillarBlock( void PillarChainManager::saveNewPillarBlock(const std::shared_ptr& pillar_block, std::vector&& new_vote_counts) { - db_->saveCurrentPillarBlockData({pillar_block, new_vote_counts}); - std::scoped_lock lock(mutex_); + db_->saveCurrentPillarBlockData({pillar_block, new_vote_counts}); current_pillar_block_ = pillar_block; current_pillar_block_vote_counts_ = std::move(new_vote_counts); } @@ -332,7 +331,6 @@ bool PillarChainManager::isValidPillarBlock(const std::shared_ptr& } const auto last_finalized_pillar_block = getLastFinalizedPillarBlock(); - std::shared_lock lock(mutex_); assert(last_finalized_pillar_block); // Check if some block was not skipped