Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix notifications getConnections #2316

Merged
merged 3 commits into from
Dec 19, 2024
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
3 changes: 2 additions & 1 deletion cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ hunter_config(

hunter_config(
libp2p
VERSION 0.1.28
URL https://github.com/libp2p/cpp-libp2p/archive/b183f881917e69c84f43099efcbbde894625376e.zip
SHA1 15ad9926f7b9dad339826ad30616e9ec415e5cb8
)

hunter_config(
Expand Down
5 changes: 4 additions & 1 deletion core/network/notifications/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ namespace kagome::network::notifications {
}
for (auto &conn :
host_->getNetwork().getConnectionManager().getConnections()) {
if (conn->isClosed()) {
continue;
}
auto peer_id = conn->remotePeer().value();
if (reserved_.contains(peer_id)) {
continue;
Expand All @@ -402,7 +405,7 @@ namespace kagome::network::notifications {

size_t Protocol::peerCount(bool out) {
size_t count = 0;
if (out) {
if (not out) {
for (auto &p : peers_in_) {
if (reserved_.contains(p.first)) {
continue;
Expand Down
Loading