Skip to content

Commit

Permalink
GH-1006 Do not include peers that are not currently connected in peer…
Browse files Browse the repository at this point in the history
… count
  • Loading branch information
heifner committed Nov 14, 2024
1 parent 4ebe18b commit 4acd24b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4828,11 +4828,9 @@ namespace eosio {
// called from any thread
void connections_manager::connection_monitor(const std::weak_ptr<connection>& from_connection) {
size_t num_rm = 0, num_clients = 0, num_peers = 0, num_bp_peers = 0;
auto cleanup = [&num_peers, &num_rm, this](vector<connection_ptr>&& reconnecting,
vector<connection_ptr>&& removing) {
auto cleanup = [&num_rm, this](vector<connection_ptr>&& reconnecting, vector<connection_ptr>&& removing) {
for( auto& c : reconnecting ) {
if (!c->resolve_and_connect()) {
--num_peers;
++num_rm;
removing.push_back(c);
}
Expand Down Expand Up @@ -4872,6 +4870,7 @@ namespace eosio {

if (!c->socket_is_open() && c->state() != connection::connection_state::connecting) {
if (!c->incoming()) {
--num_peers;
reconnecting.push_back(c);
} else {
--num_clients;
Expand Down

0 comments on commit 4acd24b

Please sign in to comment.