tuse t for tcp; wallet.blocks==-1 means connecting - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 57c1e6e92b772000915ba36d8a87a2dd471662ba DIR parent 578baf189d3b66ed77d76abf9dd34d2a218e09a1 HTML Author: ThomasV <thomasv@gitorious> Date: Fri, 30 Mar 2012 17:29:35 +0200 use t for tcp; wallet.blocks==-1 means connecting Diffstat: M client/gui.py | 5 ++++- M client/gui_qt.py | 5 ++++- M client/interface.py | 2 +- M client/wallet.py | 14 +++++++------- 4 files changed, 16 insertions(+), 10 deletions(-) --- DIR diff --git a/client/gui.py b/client/gui.py t@@ -1039,7 +1039,10 @@ class ElectrumWindow: text = "Not enough funds" elif interface.is_connected: self.network_button.set_tooltip_text("Connected to %s:%d.\n%d blocks\nresponse time: %f"%(interface.host, interface.port, self.wallet.blocks, interface.rtime)) - if self.wallet.blocks == 0: + if self.wallet.blocks == -1: + self.status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU) + text = "Connecting..." + elif self.wallet.blocks == 0: self.status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU) text = "Server not ready" elif not self.wallet.up_to_date: DIR diff --git a/client/gui_qt.py b/client/gui_qt.py t@@ -187,7 +187,10 @@ class ElectrumWindow(QMainWindow): def update_wallet(self): if self.wallet.interface.is_connected: - if self.wallet.blocks == 0: + if self.wallet.blocks == -1: + text = "Connecting..." + icon = QIcon(":icons/status_disconnected.png") + elif self.wallet.blocks == 0: text = "Server not ready" icon = QIcon(":icons/status_disconnected.png") elif not self.wallet.up_to_date: DIR diff --git a/client/interface.py b/client/interface.py t@@ -21,7 +21,7 @@ import random, socket, ast import thread, threading, traceback, sys, time, json, Queue DEFAULT_TIMEOUT = 5 -DEFAULT_SERVERS = ['ecdsa.org:50001:s'] # ['electrum.bitcoins.sk','ecdsa.org','electrum.novit.ro'] # list of default servers +DEFAULT_SERVERS = ['ecdsa.org:50001:t'] # ['electrum.bitcoins.sk','ecdsa.org','electrum.novit.ro'] # list of default servers def old_to_new(s): DIR diff --git a/client/wallet.py b/client/wallet.py t@@ -268,7 +268,7 @@ class Wallet: self.remote_url = None self.was_updated = True - self.blocks = 0 + self.blocks = -1 self.banner = '' self.up_to_date_event = threading.Event() self.up_to_date_event.clear() t@@ -955,12 +955,12 @@ class Wallet: host = item[1] if len(item)>2: for v in item[2]: - if re.match("[nsh]\d+",v): + if re.match("[thn]\d+",v): s.append(host+":"+v[1:]+":"+v[0]) - if not s: - s.append(host+":50000:n") - else: - s.append(host+":50000:n") + #if not s: + # s.append(host+":50000:n") + #else: + # s.append(host+":50000:n") servers = servers + s self.interface.servers = servers t@@ -1017,7 +1017,7 @@ class Wallet: if protocol == 'n': InterfaceClass = NativeInterface - elif protocol == 's': + elif protocol == 't': InterfaceClass = AsynchronousInterface elif protocol == 'h': InterfaceClass = HttpInterface