electrum

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

commit 57c1e6e92b772000915ba36d8a87a2dd471662ba
parent 578baf189d3b66ed77d76abf9dd34d2a218e09a1
Author: ThomasV <thomasv@gitorious>
Date:   Fri, 30 Mar 2012 17:29:35 +0200

use t for tcp; wallet.blocks==-1 means connecting

Diffstat:
Mclient/gui.py | 5++++-
Mclient/gui_qt.py | 5++++-
Mclient/interface.py | 2+-
Mclient/wallet.py | 14+++++++-------
4 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/client/gui.py b/client/gui.py @@ -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: diff --git a/client/gui_qt.py b/client/gui_qt.py @@ -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: diff --git a/client/interface.py b/client/interface.py @@ -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): diff --git a/client/wallet.py b/client/wallet.py @@ -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() @@ -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 @@ -1017,7 +1017,7 @@ class Wallet: if protocol == 'n': InterfaceClass = NativeInterface - elif protocol == 's': + elif protocol == 't': InterfaceClass = AsynchronousInterface elif protocol == 'h': InterfaceClass = HttpInterface