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

This commit is contained in:
ThomasV 2012-03-30 17:29:35 +02:00
parent 578baf189d
commit 57c1e6e92b
4 changed files with 16 additions and 10 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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):

View File

@ -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