From e7e9e8916b60e04c7eda9afffa255c466ca5c9f1 Mon Sep 17 00:00:00 2001 From: thomasv Date: Tue, 2 Oct 2012 12:52:47 +0200 Subject: [PATCH] fix set_server. keep compatibility with the gtk interface --- lib/gui_qt.py | 6 +++++- lib/wallet.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/gui_qt.py b/lib/gui_qt.py index 25b946027..2207a6e1c 100644 --- a/lib/gui_qt.py +++ b/lib/gui_qt.py @@ -1450,7 +1450,11 @@ class ElectrumWindow(QMainWindow): try: cfg.set_key("proxy", { u'mode':unicode(proxy_mode.currentText()).lower(), u'host':unicode(proxy_host.text()), u'port':unicode(proxy_port.text()) }, True) - wallet.set_server(server, cfg.config["proxy"]) + if cfg.config["proxy"]["mode"] != "none": + wallet.set_server(server, cfg.config["proxy"]) + else: + wallet.set_server(server) + except Exception as err: QMessageBox.information(None, _('Error'), str(err), _('OK')) if parent == None: diff --git a/lib/wallet.py b/lib/wallet.py index 06409d606..b24205083 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -347,7 +347,7 @@ class Wallet: def is_up_to_date(self): return self.interface.responses.empty() and not self.interface.unanswered_requests - def set_server(self, server, proxy): + def set_server(self, server, proxy=None): # raise an error if the format isnt correct a,b,c = server.split(':') b = int(b)