fix: replace RNS.Link.FAILED with TIMEOUT and STALE

RNS.Link has no FAILED constant — the terminal non-ACTIVE states are
CLOSED, TIMEOUT, and STALE.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciek "mab122" Bator 2026-04-24 12:44:22 +02:00
parent 5658042a7e
commit a14f39f93a
1 changed files with 3 additions and 3 deletions

View File

@ -326,7 +326,7 @@ class RadicleBridge:
link = RNS.Link(remote_dest)
deadline = time.time() + half
while link.status != RNS.Link.ACTIVE:
if link.status in (RNS.Link.CLOSED, RNS.Link.FAILED):
if link.status in (RNS.Link.CLOSED, RNS.Link.TIMEOUT, RNS.Link.STALE):
return None
if time.time() > deadline:
return None
@ -494,9 +494,9 @@ class RadicleBridge:
# Wait for link establishment (Noise XK handshake)
deadline = time.time() + 30.0
while rns_link.status != RNS.Link.ACTIVE:
if rns_link.status in (RNS.Link.CLOSED, RNS.Link.FAILED):
if rns_link.status in (RNS.Link.CLOSED, RNS.Link.TIMEOUT, RNS.Link.STALE):
RNS.log(
"Link closed/failed before becoming active",
"Link closed/timed out before becoming active",
RNS.LOG_WARNING,
)
tcp_socket.close()