From cdbe5f80e2b3686262ba785f33062f2ebc6c5b2a Mon Sep 17 00:00:00 2001 From: Kashiko Koibumi Date: Wed, 15 May 2024 12:41:50 +0900 Subject: [PATCH] fix exception from network status --- src/bitmessageqt/networkstatus.py | 4 ++-- src/network/dandelion.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bitmessageqt/networkstatus.py b/src/bitmessageqt/networkstatus.py index ac84f524..32cb3469 100644 --- a/src/bitmessageqt/networkstatus.py +++ b/src/bitmessageqt/networkstatus.py @@ -195,9 +195,9 @@ class NetworkStatus(QtWidgets.QWidget, RetranslateMixin): if not connectionpool.pool.inboundConnections: self.window().setStatusIcon('yellow') for i in range(self.tableWidgetConnectionCount.rowCount()): - if self.tableWidgetConnectionCount.item(i, 0).data(QtCore.Qt.ItemDataRole.UserRole).toPyObject() != destination: + if self.tableWidgetConnectionCount.item(i, 0).data(QtCore.Qt.ItemDataRole.UserRole) != destination: continue - if self.tableWidgetConnectionCount.item(i, 1).data(QtCore.Qt.ItemDataRole.UserRole).toPyObject() == outbound: + if self.tableWidgetConnectionCount.item(i, 1).data(QtCore.Qt.ItemDataRole.UserRole) == outbound: self.tableWidgetConnectionCount.removeRow(i) break diff --git a/src/network/dandelion.py b/src/network/dandelion.py index 300ecc31..1d5a997a 100644 --- a/src/network/dandelion.py +++ b/src/network/dandelion.py @@ -189,8 +189,8 @@ class Dandelion: # pylint: disable=old-style-class try: # random two connections self.stem = sample( - connectionpool.BMConnectionPool( - ).outboundConnections.values(), MAX_STEMS) + sorted(connectionpool.BMConnectionPool( + ).outboundConnections.values()), MAX_STEMS) # not enough stems available except ValueError: self.stem = connectionpool.BMConnectionPool(