Skip to content

Commit

Permalink
Merge pull request #1037 from AntelopeIO/GH-1006-p2p-client-count-main
Browse files Browse the repository at this point in the history
[1.0.4 -> main] P2P: Fix peer connections log output
  • Loading branch information
heifner authored Nov 18, 2024
2 parents 9afe8c3 + 9c3fb8d commit 60fc43d
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 @@ -4685,11 +4685,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 @@ -4729,6 +4727,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 60fc43d

Please sign in to comment.