Skip to content

Commit

Permalink
Ignore and remove duplicated links
Browse files Browse the repository at this point in the history
  • Loading branch information
kyechou committed Jul 29, 2024
1 parent c712cd7 commit 339512f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ void Network::add_link(Link *link) {
// Add the new link to _links
auto res = _links.insert(link);
if (res.second == false) {
logger.error("Duplicate link: " + (*res.first)->to_string());
// logger.error("Duplicate link: " + (*res.first)->to_string());
// Ignore duplicated links, which may be caused by directed graph
// inputs.
delete link;
return;
}

// Add the new peer to the respective node structures
Expand Down
1 change: 0 additions & 1 deletion src/node.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "node.hpp"

#include <typeinfo>
#include <utility>

#include "logger.hpp"
Expand Down

0 comments on commit 339512f

Please sign in to comment.