Skip to content

Commit

Permalink
fix more warnings
Browse files Browse the repository at this point in the history
move log severity up to critical
  • Loading branch information
canepat committed Jan 24, 2024
1 parent a5597c8 commit e754660
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion silkworm/rpc/test/api_test_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void populate_blocks(db::RWTxn& txn, const std::filesystem::path& tests_dir, InM
}
auto ruleSet = protocol::rule_set_factory(*chain_config);

while (rlp_view.length() > 0) {
while (!rlp_view.empty()) {
silkworm::Block block;

if (!silkworm::rlp::decode(rlp_view, block, silkworm::rlp::Leftover::kAllow)) {
Expand Down
8 changes: 4 additions & 4 deletions silkworm/sync/block_exchange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

namespace silkworm {

BlockExchange::BlockExchange(SentryClient& sentry, const db::ROAccess& dba, const ChainConfig& chain_config)
: db_access_{dba},
BlockExchange::BlockExchange(SentryClient& sentry, db::ROAccess dba, const ChainConfig& chain_config)
: db_access_{std::move(dba)},
sentry_{sentry},
chain_config_{chain_config},
header_chain_{chain_config},
Expand Down Expand Up @@ -141,7 +141,7 @@ void BlockExchange::execution_loop() {

log::Debug("BlockExchange") << "execution_loop is stopping...";
} catch (std::exception& e) {
log::Error("BlockExchange") << "execution loop aborted due to exception: " << e.what();
log::Critical("BlockExchange") << "execution loop aborted due to exception: " << e.what();
}

stop();
Expand Down Expand Up @@ -268,7 +268,7 @@ void BlockExchange::download_blocks(BlockNum current_height, Target_Tracking) {
// todo: handle the Target_Tracking mode

auto message = std::make_shared<InternalMessage<void>>(
[=, this](HeaderChain& hc, BodySequence& bc) {
[this, current_height](HeaderChain& hc, BodySequence& bc) {
hc.current_state(current_height);
bc.current_state(current_height);
downloading_active_ = true; // must be done after sync current_state
Expand Down
4 changes: 2 additions & 2 deletions silkworm/sync/block_exchange.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class SentryClient;
//! \brief Implement the logic needed to download headers and bodies
class BlockExchange : public ActiveComponent {
public:
BlockExchange(SentryClient&, const db::ROAccess&, const ChainConfig&);
BlockExchange(SentryClient&, db::ROAccess, const ChainConfig&);
~BlockExchange() override;

// public interface for block downloading

void initial_state(std::vector<BlockHeader> last_headers); // set the initial state of the sync

enum class Target_Tracking {
enum class Target_Tracking : uint8_t {
kByAnnouncements,
kByNewPayloads
};
Expand Down

0 comments on commit e754660

Please sign in to comment.