Skip to content
Snippets Groups Projects
Commit c3e1a4a4 authored by inso's avatar inso
Browse files

Fix error when less than 6 nodes are available

parent 7b498101
No related branches found
No related tags found
No related merge requests found
...@@ -297,10 +297,12 @@ class BmaAccess(QObject): ...@@ -297,10 +297,12 @@ class BmaAccess(QObject):
.. note:: If one node accept the requests (returns 200), .. note:: If one node accept the requests (returns 200),
the broadcast should be considered accepted by the network. the broadcast should be considered accepted by the network.
""" """
nodes = self._network.synced_nodes nodes = random.sample(self._network.synced_nodes, 6) \
if len(self._network.synced_nodes) > 6 \
else self._network.synced_nodes
replies = [] replies = []
if len(nodes) > 0: if len(nodes) > 0:
for node in random.sample(nodes, 6): for node in nodes:
logging.debug("Trying to connect to : " + node.pubkey) logging.debug("Trying to connect to : " + node.pubkey)
conn_handler = node.endpoint.conn_handler() conn_handler = node.endpoint.conn_handler()
req = request(conn_handler, **req_args) req = request(conn_handler, **req_args)
......
...@@ -65,8 +65,8 @@ class TestCertificationDialog(unittest.TestCase, QuamashTest): ...@@ -65,8 +65,8 @@ class TestCertificationDialog(unittest.TestCase, QuamashTest):
self.assertEqual(result, QDialog.Accepted) self.assertEqual(result, QDialog.Accepted)
def close_dialog(): def close_dialog():
if certification_dialog.isVisible(): if certification_dialog.widget.isVisible():
certification_dialog.close() certification_dialog.widget.close()
async def exec_test(): async def exec_test():
await asyncio.sleep(1) await asyncio.sleep(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment