electrum

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

commit 510934d545659edaeddc76f357dd42f9be474042
parent f489466709abc2e737fd5100c3131ac078eda91c
Author: ThomasV <thomasv@gitorious>
Date:   Sat, 28 Feb 2015 15:37:50 +0100

do not store protocol explicitly

Diffstat:
Mlib/network.py | 10+++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/lib/network.py b/lib/network.py @@ -95,23 +95,20 @@ class Network(threading.Thread): self.blockchain = Blockchain(self.config, self) self.interfaces = {} self.queue = Queue.Queue() - self.protocol = self.config.get('protocol','s') - # sanitize protocol - if self.protocol not in 'sght': self.protocol = 's' self.running = False - # Server for addresses and transactions self.default_server = self.config.get('server') # Sanitize default server try: host, port, protocol = self.default_server.split(':') - assert protocol == self.protocol + assert protocol in 'st' int(port) except: self.default_server = None if not self.default_server: - self.default_server = pick_random_server(self.protocol) + self.default_server = pick_random_server('s') + self.protocol = self.default_server.split(':')[2] self.irc_servers = {} # returned by interface (list from irc) self.disconnected_servers = set([]) @@ -246,7 +243,6 @@ class Network(threading.Thread): server_str = ':'.join([ host, port, protocol ]) self.config.set_key('auto_cycle', auto_connect, True) self.config.set_key("proxy", proxy_str, True) - self.config.set_key("protocol", protocol, True) self.config.set_key("server", server_str, True) if self.proxy != proxy_str or self.protocol != protocol: