Skip to content

Commit

Permalink
Disable dead code, style.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Apr 21, 2024
1 parent f588b0c commit 6d27ab5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/node/chasers/chaser_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class BCN_API chaser_check
private:
typedef std::deque<map_ptr> maps;

////size_t count_maps(const maps& table) const NOEXCEPT;
size_t get_unassociated(maps& table, size_t start) const NOEXCEPT;
size_t count_map(const maps& table) const NOEXCEPT;
map_ptr get_map(maps& table) NOEXCEPT;

// These are thread safe.
Expand Down
26 changes: 13 additions & 13 deletions src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void chaser_check::do_purge_headers(height_t top) NOEXCEPT
// be purged, it simply means purge all hashes (reset all). All channels
// will get the purge notification before any subsequent download notify.
maps_.clear();
////LOGN("Hashes purged (" << count_map(maps_) << ") remain.");
////LOGN("Hashes purged (" << count_maps(maps_) << ") remain.");
notify(error::success, chase::purge, top);
}

Expand All @@ -193,7 +193,7 @@ void chaser_check::do_get_hashes(const map_handler& handler) NOEXCEPT
BC_ASSERT(stranded());

const auto map = get_map(maps_);
////LOGN("Hashes -" << map->size() << " (" << count_map(maps_) << ") remain.");
////LOGN("Hashes -" << map->size() << " (" << count_maps(maps_) << ") remain.");
handler(error::success, map);
}

Expand All @@ -206,7 +206,7 @@ void chaser_check::do_put_hashes(const map_ptr& map,
{
maps_.push_back(map);
notify(error::success, chase::download, map->size());
////LOGN("Hashes +" << map->size() << " (" << count_map(maps_) << ") remain.");
////LOGN("Hashes +" << map->size() << " (" << count_maps(maps_) << ") remain.");
}

handler(error::success);
Expand All @@ -231,7 +231,7 @@ void chaser_check::do_malleated(header_t link) NOEXCEPT
}

maps_.push_back(std::make_shared<associations>(associations{ out }));
////LOGN("Hashes +1 malleated (" << count_map(maps_) << ") remain.");
////LOGN("Hashes +1 malleated (" << count_maps(maps_) << ") remain.");
notify(error::success, chase::download, one);
}

Expand All @@ -256,20 +256,20 @@ size_t chaser_check::get_unassociated(maps& table, size_t start) const NOEXCEPT
}
}

size_t chaser_check::count_map(const maps& table) const NOEXCEPT
{
return std::accumulate(table.begin(), table.end(), zero,
[](size_t sum, const map_ptr& map) NOEXCEPT
{
return sum + map->size();
});
}

map_ptr chaser_check::get_map(maps& table) NOEXCEPT
{
return table.empty() ? empty_map() : pop_front(table);
}

////size_t chaser_check::count_maps(const maps& table) const NOEXCEPT
////{
//// return std::accumulate(table.begin(), table.end(), zero,
//// [](size_t sum, const map_ptr& map) NOEXCEPT
//// {
//// return sum + map->size();
//// });
////}

BC_POP_WARNING()
BC_POP_WARNING()
BC_POP_WARNING()
Expand Down

0 comments on commit 6d27ab5

Please sign in to comment.