electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit da5c18b2f99a9a93506f30e22ab943e91c831b55
parent f5a43b873874caaf0fcf489ed316d07ca47c252a
Author: Neil Booth <kyuupichan@gmail.com>
Date:   Sun,  6 Sep 2015 20:03:43 +0900

Be patient whilst connecting

On startup we make several connections simultaneously.  Socket
maintenance code checks if we're not connected, and if not
switches to a connected interface if auto_connect.
Unfortunately this meant that we frequently didn't reconnect to
the prior good server on startup, because some other connection
would happen first and this code would decide to switch to it.

Instead, only switch if a connection attempt is not in progress.
If that times out at the O/S level the switch will happen.

Diffstat:
Mlib/network.py | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/network.py b/lib/network.py @@ -642,7 +642,8 @@ class Network(util.DaemonThread): # main interface if not self.is_connected(): if self.auto_connect: - self.switch_to_random_interface() + if not self.is_connecting(): + self.switch_to_random_interface() else: if self.default_server in self.disconnected_servers: if now - self.server_retry_time > SERVER_RETRY_INTERVAL: