commit d1a5fa5b9789bcabebc761e976ec400e9af9ba84
parent a579e1555e1b3fc33fc3aab98605d2ff008cfd0a
Author: ThomasV <thomasv@gitorious>
Date: Sat, 31 Mar 2012 14:20:25 +0200
fix servers list
Diffstat:
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/client/gui.py b/client/gui.py
@@ -30,6 +30,7 @@ APP_NAME = "Electrum"
MONOSPACE_FONT = "monospace"
from wallet import format_satoshis
+from interface import DEFAULT_SERVERS
def numbify(entry, is_int = False):
text = entry.get_text().strip()
@@ -266,6 +267,7 @@ def run_settings_dialog(wallet, parent):
+
def run_network_dialog( wallet, parent ):
image = gtk.Image()
image.set_from_stock(gtk.STOCK_NETWORK, gtk.ICON_SIZE_DIALOG)
@@ -279,7 +281,7 @@ def run_network_dialog( wallet, parent ):
else:
import random
status = "Please choose a server."
- server = random.choice( interface.servers )
+ server = random.choice( DEFAULT_SERVERS )
dialog = gtk.MessageDialog( parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, status)
diff --git a/client/gui_qt.py b/client/gui_qt.py
@@ -24,6 +24,7 @@ from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
+from interface import DEFAULT_SERVERS
try:
import icons_rc
@@ -847,7 +848,7 @@ class ElectrumWindow(QMainWindow):
else:
import random
status = "Please choose a server."
- server = random.choice( interface.servers )
+ server = random.choice( DEFAULT_SERVERS )
plist = {}
for item in wallet.interface.servers:
diff --git a/client/interface.py b/client/interface.py
@@ -21,7 +21,7 @@ import random, socket, ast, re
import threading, traceback, sys, time, json, Queue
DEFAULT_TIMEOUT = 5
-DEFAULT_SERVERS = [ ('ecdsa.org', [('t','50001')]) ] # ['electrum.bitcoins.sk','ecdsa.org','electrum.novit.ro'] # list of default servers
+DEFAULT_SERVERS = [ 'ecdsa.org:50001:t', 'electrum.novit.ro:50001:t'] # list of default servers
def old_to_new(s):
diff --git a/client/wallet.py b/client/wallet.py
@@ -277,16 +277,10 @@ class Wallet:
#
self.addresses_waiting_for_status = []
self.addresses_waiting_for_history = []
+ self.server = random.choice( DEFAULT_SERVERS ) # random choice when the wallet is created
- self.pick_random_server()
-
- def pick_random_server(self):
- host, pp = random.choice( DEFAULT_SERVERS ) # random choice when the wallet is created
- protocol, port = pp[0]
- self.server = host + ':' + port + ':' + protocol
-
def is_up_to_date(self):
return self.interface.responses.empty() and not ( self.addresses_waiting_for_status or self.addresses_waiting_for_history )