Limit each peer to one connection

Prevents dialing the same peer multiple times (successfully).
This commit is contained in:
Luke Parker
2025-01-09 00:06:51 -05:00
parent 75a00f2a1a
commit dda6e3e899
6 changed files with 19 additions and 11 deletions

View File

@@ -225,8 +225,10 @@ impl SwarmTask {
}
}
SwarmEvent::Behaviour(BehaviorEvent::AllowList(event)) => {
// Ensure this is an unreachable case, not an actual event
SwarmEvent::Behaviour(
BehaviorEvent::AllowList(event) | BehaviorEvent::ConnectionLimits(event)
) => {
// Ensure these are unreachable cases, not actual events
let _: void::Void = event;
}
SwarmEvent::Behaviour(