fix(relay): only unbind a channel if it is actually bound (#4495)

Currently, we are emitting the "Channel is now expired" message multiple
times because we don't filter for the ones we have already unbound.
This commit is contained in:
Thomas Eizinger
2024-04-04 12:09:58 +11:00
committed by GitHub
parent f0e7143b8d
commit 285249a384

View File

@@ -460,7 +460,7 @@ where
for ((client, number), channel) in self
.channels_by_client_and_number
.iter_mut()
.filter(|(_, c)| c.is_expired(now))
.filter(|(_, c)| c.is_expired(now) && c.bound)
{
tracing::info!(target: "relay", channel = %number, %client, peer = %channel.peer_address, allocation = %channel.allocation, "Channel is now expired");