Abort early on non-enabled link mode

This commit is contained in:
Mark Qvist committed 2026-11-17 03:01:36 +01:00
1 parent 12b2b8c013
commit 4916017aee
1 file changed
+1
+1
View File
@@ -239,6 +239,7 @@ class Link:
def __init__(self, destination=None, established_callback=None, closed_callback=None, owner=None, peer_pub_bytes=None, peer_sig_pub_bytes=None, mode=MODE_DEFAULT):
if destination != None and destination.type != RNS.Destination.SINGLE: raise TypeError("Links can only be established to the \"single\" destination type")
if not mode in Link.ENABLED_MODES: raise TypeError(f"Requested link mode {Link.MODE_DESCRIPTIONS[mode]} not enabled")
self.mode = mode
self.link_id = None
self.rtt = None