From c9e0246266c63902ea2b01a80a6402f0aafbca1e Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 2 Mar 2015 22:04:58 -0800 Subject: [PATCH] relay: reset channel-id to 1 when all channels are idle --- src/wormhole/servers/relay.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wormhole/servers/relay.py b/src/wormhole/servers/relay.py index 8357a1d..c9d5641 100644 --- a/src/wormhole/servers/relay.py +++ b/src/wormhole/servers/relay.py @@ -124,6 +124,8 @@ class Relay(resource.Resource): self.channels.pop(channel_id) log.msg("freed %d, now have %d channels" % (channel_id, len(self.channels))) + if not self.channels: + self.next_channel = 1 class TransitConnection(protocol.Protocol): def __init__(self):