From ca122dc1ba0e6b421cedefd2d48d5180fd5482f5 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 23 Jul 2018 15:04:36 -0500 Subject: [PATCH] upload to multiple peers --- onionr/communicator2.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/onionr/communicator2.py b/onionr/communicator2.py index 31d59bf6..a4c3e023 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -348,14 +348,15 @@ class OnionrCommunicatorDaemon: self.decrementThreadCount('daemonCommands') def uploadBlock(self): - tiredPeers = [] + triedPeers = [] if not self._core._utils.validateHash(self.blockToUpload): logger.warn('Requested to upload invalid block') return for i in max(len(self.onlinePeers), 2): - while True: - peer = self.pickOnlinePeer() - if peer + peer = self.pickOnlinePeer() + if peer in triedPeers: + continue + triedPeers.append(peer) url = 'http://' + peer + '/public/upload/' data = {'block': block.Block(self.blockToUpload).getRaw()} if peer.endswith('.onion'):