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):