From 7b498101962cfcb520fdb96c94e266bfc669ed9d Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Wed, 27 Jan 2016 20:25:24 +0100 Subject: [PATCH] Broadcast to 6 random nodes instead of all nodes --- src/sakia/core/net/api/bma/access.py | 4 ++-- src/sakia/gui/certification.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sakia/core/net/api/bma/access.py b/src/sakia/core/net/api/bma/access.py index 9324a382..fd0fa7ee 100644 --- a/src/sakia/core/net/api/bma/access.py +++ b/src/sakia/core/net/api/bma/access.py @@ -297,10 +297,10 @@ class BmaAccess(QObject): .. note:: If one node accept the requests (returns 200), the broadcast should be considered accepted by the network. """ - nodes = self._network.online_nodes + nodes = self._network.synced_nodes replies = [] if len(nodes) > 0: - for node in nodes: + for node in random.sample(nodes, 6): logging.debug("Trying to connect to : " + node.pubkey) conn_handler = node.endpoint.conn_handler() req = request(conn_handler, **req_args) diff --git a/src/sakia/gui/certification.py b/src/sakia/gui/certification.py index 3ae4f3fa..4b847b30 100644 --- a/src/sakia/gui/certification.py +++ b/src/sakia/gui/certification.py @@ -149,7 +149,6 @@ class CertificationDialog(QObject): :rtype: str """ pubkey = None - self.ui.button_box.setEnabled(False) if self.ui.radio_contact.isChecked(): for contact in self.account.contacts: if contact['name'] == self.ui.combo_contact.currentText(): -- GitLab