From 6d27ab5ae0fb4b4a9fc3f78bd4b58964e36bea15 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 21 Apr 2024 17:27:14 -0400 Subject: [PATCH] Disable dead code, style. --- include/bitcoin/node/chasers/chaser_check.hpp | 2 +- src/chasers/chaser_check.cpp | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/bitcoin/node/chasers/chaser_check.hpp b/include/bitcoin/node/chasers/chaser_check.hpp index 519ea9ba..36dab224 100644 --- a/include/bitcoin/node/chasers/chaser_check.hpp +++ b/include/bitcoin/node/chasers/chaser_check.hpp @@ -67,8 +67,8 @@ class BCN_API chaser_check private: typedef std::deque 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. diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index 8a7cb0e2..0564d1ce 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -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); } @@ -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); } @@ -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); @@ -231,7 +231,7 @@ void chaser_check::do_malleated(header_t link) NOEXCEPT } maps_.push_back(std::make_shared(associations{ out })); - ////LOGN("Hashes +1 malleated (" << count_map(maps_) << ") remain."); + ////LOGN("Hashes +1 malleated (" << count_maps(maps_) << ") remain."); notify(error::success, chase::download, one); } @@ -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()