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(