From 5355f0e91f1a54f14297a2e744838eac5a719a82 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 15 May 2025 15:58:21 +0200 Subject: [PATCH] Fixed link stats in object details --- sbapp/sideband/core.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index dff6a52..8fa432c 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -1896,12 +1896,12 @@ class SidebandCore(): mr = self.message_router oh = destination_hash ol = None - if oh in mr.direct_links: + if oh in mr.direct_links and mr.direct_links[oh].status == RNS.Link.ACTIVE: ol = mr.direct_links[oh] elif oh in mr.backchannel_links: ol = mr.backchannel_links[oh] - if ol != None: + if ol != None and ol.status == RNS.Link.ACTIVE: ler = ol.get_establishment_rate() if ler: return ler @@ -1931,12 +1931,12 @@ class SidebandCore(): mr = self.message_router oh = destination_hash ol = None - if oh in mr.direct_links: + if oh in mr.direct_links and mr.direct_links[oh].status == RNS.Link.ACTIVE: ol = mr.direct_links[oh] elif oh in mr.backchannel_links: ol = mr.backchannel_links[oh] - if ol != None: + if ol != None and ol.status == RNS.Link.ACTIVE: return ol.get_mtu() return None @@ -1964,12 +1964,12 @@ class SidebandCore(): mr = self.message_router oh = destination_hash ol = None - if oh in mr.direct_links: + if oh in mr.direct_links and mr.direct_links[oh].status == RNS.Link.ACTIVE: ol = mr.direct_links[oh] elif oh in mr.backchannel_links: ol = mr.backchannel_links[oh] - if ol != None: + if ol != None and ol.status == RNS.Link.ACTIVE: return ol.get_expected_rate() return None @@ -1997,12 +1997,12 @@ class SidebandCore(): mr = self.message_router oh = destination_hash ol = None - if oh in mr.direct_links: + if oh in mr.direct_links and mr.direct_links[oh].status == RNS.Link.ACTIVE: ol = mr.direct_links[oh] elif oh in mr.backchannel_links: ol = mr.backchannel_links[oh] - if ol != None: return ol.get_mode() + if ol != None and ol.status == RNS.Link.ACTIVE: return ol.get_mode() return None @@ -2072,6 +2072,8 @@ class SidebandCore(): connection.send(self._get_destination_mtu(call["get_destination_mtu"])) elif "get_destination_edr" in call: connection.send(self._get_destination_edr(call["get_destination_edr"])) + elif "get_destination_lmd" in call: + connection.send(self._get_destination_lmd(call["get_destination_lmd"])) elif "send_message" in call: args = call["send_message"] send_result = self.send_message(