Skip to content

Commit

Permalink
fix(connlib): remove outdated assertion due to possibility of network…
Browse files Browse the repository at this point in the history
… changes and drain events after refreshing allocations on reconnect
  • Loading branch information
conectado committed Mar 19, 2024
1 parent baa2831 commit 45fd085
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions rust/connlib/snownet/src/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,12 +961,10 @@ impl ChannelBindings {
}

fn handle_failed_binding(&mut self, c: u16) {
let Some(channel) = self.inner.remove(&c) else {
if self.inner.remove(&c).is_none() {
debug_assert!(false, "No channel binding for {c}");
return;
};

debug_assert!(!channel.bound, "Channel should not yet be bound")
}

fn set_confirmed(&mut self, c: u16, now: Instant) -> bool {
Expand Down
2 changes: 2 additions & 0 deletions rust/connlib/snownet/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ where
for allocation in self.allocations.values_mut() {
allocation.refresh(now);
}

self.bindings_and_allocations_drain_events();
}

pub fn public_key(&self) -> PublicKey {
Expand Down

0 comments on commit 45fd085

Please sign in to comment.