Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/bitcoin/node/impl/chasers/chaser_organize.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void CLASS::do_organize(typename Block::cptr block, bool prioritized,
}

const auto it = tree_.find(hash);
if (it != tree_.end())
if (it != tree_.cend())
{
handler(error_duplicate(), it->second->get_state()->height());
return;
Expand Down Expand Up @@ -354,7 +354,7 @@ void CLASS::do_prioritize(const system::hash_digest& hash,
return;

// Only the top of a cached branch can tie the candidate top.
if (std::any_of(tree_.begin(), tree_.end(), [&](const auto& item) NOEXCEPT
if (std::any_of(tree_.cbegin(), tree_.cend(), [&](const auto& item) NOEXCEPT
{
return get_header(*item.second).previous_block_hash() == hash;
}))
Expand Down Expand Up @@ -661,7 +661,7 @@ void CLASS::shrink_tree(bool current) NOEXCEPT
return;

shrunk_ = true;
tree_ = { tree_.begin(), tree_.end() };
tree_ = { tree_.cbegin(), tree_.cend() };
LOGV("Tree buckets reduced to (" << tree_.bucket_count() << ").");
}

Expand Down
4 changes: 2 additions & 2 deletions src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void chaser_check::do_starved(object_t self) NOEXCEPT
BC_ASSERT(stranded());

// Remove the starved channel to prevent self-selection.
if (speeds_.find(self) != speeds_.end())
if (speeds_.find(self) != speeds_.cend())
speeds_.erase(self);

// Find the slowest reporting channel.
Expand All @@ -232,7 +232,7 @@ void chaser_check::do_starved(object_t self) NOEXCEPT
});

// Direct the slowest channel to split work and stop.
if (slowest != speeds_.end())
if (slowest != speeds_.cend())
{
// Erase entry so less likely to be claimed again before stopping.
const auto slow = slowest->first;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/protocol_block_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
const auto& block = message->block;
const auto hash = block.hash();
const auto it = map_->find(hash);
if (it == map_->end())
if (it == map_->cend())
{
// Allow unrequested block, not counted toward performance.
LOGR("Unrequested block [" << encode_hash(hash) << "] from ["
Expand Down
Loading