tuse ssl as default protocol - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 84101a446b3b508c04ea5a03968d79c232a745e5 DIR parent 19cbe609a43315a86ddcd87d6eaca32ee4ce2824 HTML Author: ecdsa <ecdsa@github> Date: Mon, 1 Apr 2013 12:11:24 +0200 use ssl as default protocol Diffstat: M gui/gui_classic.py | 12 ++++++------ M lib/interface.py | 33 +++++++++++++++++++------------ M lib/wallet.py | 2 +- 3 files changed, 27 insertions(+), 20 deletions(-) --- DIR diff --git a/gui/gui_classic.py b/gui/gui_classic.py t@@ -31,7 +31,7 @@ from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import PyQt4.QtGui as QtGui -from electrum.interface import DEFAULT_SERVERS +from electrum.interface import DEFAULT_SERVERS, DEFAULT_PORTS from electrum.bitcoin import MIN_RELAY_TX_FEE try: t@@ -2146,9 +2146,8 @@ class ElectrumWindow(QMainWindow): server_port = QLineEdit() server_port.setFixedWidth(60) - protocol_names = ['TCP', 'HTTP', 'TCP/SSL', 'HTTPS'] + protocol_names = ['TCP', 'HTTP', 'SSL', 'HTTPS'] protocol_letters = 'thsg' - DEFAULT_PORTS = {'t':'50001', 's':'50002', 'h':'8081', 'g':'8082'} server_protocol.addItems(protocol_names) grid.addWidget(QLabel(_('Server') + ':'), 0, 0) t@@ -2184,8 +2183,8 @@ class ElectrumWindow(QMainWindow): if not port: protocol = None if not protocol: - if 't' in pp.keys(): - protocol = 't' + if 's' in pp.keys(): + protocol = 's' port = pp.get(protocol) else: protocol = pp.keys()[0] t@@ -2209,7 +2208,8 @@ class ElectrumWindow(QMainWindow): host, port, protocol = server.split(':') change_server(host,protocol) - servers_list_widget.connect(servers_list_widget, SIGNAL('itemClicked(QTreeWidgetItem*, int)'), lambda x: change_server(unicode(x.text(0)))) + servers_list_widget.connect(servers_list_widget, SIGNAL('currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)'), + lambda x,y: change_server(unicode(x.text(0)))) grid.addWidget(servers_list_widget, 1, 1, 1, 3) if not wallet.config.is_modifiable('server'): DIR diff --git a/lib/interface.py b/lib/interface.py t@@ -25,18 +25,23 @@ from util import print_error, print_msg DEFAULT_TIMEOUT = 5 +DEFAULT_PORTS = {'t':'50001', 's':'50002', 'h':'8081', 'g':'8082'} DEFAULT_SERVERS = [ - #'electrum.bitcoins.sk:50001:t', - #'uncle-enzo.info:50001:t', - #'electrum.bitfoo.org:50001:t', - #'webbtc.net:50001:t', - 'electrum.bitcoin.cz:50001:t', - 'electrum.novit.ro:50001:t', - 'electrum.be:50001:t', - 'electrum.bysh.me:50001:t', - 'electrum.pdmc.net:50001:t', - 'electrum.no-ip.org:50001:t', - 'ecdsa.org:50001:t' + 'electrum.bitcoin.cz:50002:s', + 'electrum.novit.ro:50002:s', + 'electrum.be:50002:s', + 'electrum.bysh.me:50002:s', + 'electrum.pdmc.net:50002:s', + 'electrum.no-ip.org:50002:s', + 'ecdsa.org:50002:s', + 'electra.datemas.de:50002:s', + 'electrum.datemas.de:50002:s', + 'electrum.mooo.com:50002:s', + 'btcback.com:50002:s', + 'electrum.bitcoins.sk:50002:s', + 'btc.stytt.com:50002:s', + 'electrum.stepkrav.pw:50002:s', + 'btc.it-zone.org:110:s' ] # add only port 80 servers here t@@ -121,8 +126,10 @@ class Interface(threading.Thread): pruning = False if len(item) > 2: for v in item[2]: - if re.match("[stgh]\d+", v): - ports.append((v[0], v[1:])) + if re.match("[stgh]\d*", v): + protocol, port = v[0], v[1:] + if port == '': port = DEFAULT_PORTS[protocol] + ports.append((protocol, port)) elif re.match("v(.?)+", v): version = v[1:] elif v == 'p': DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -1085,7 +1085,7 @@ class WalletSynchronizer(threading.Thread): self.wallet.receive_tx_callback(tx_hash, tx, tx_height) self.was_updated = True requested_tx.remove( (tx_hash, tx_height) ) - print_error("received tx:", tx) + print_error("received tx:", tx_hash, len(tx.raw)) elif method == 'blockchain.transaction.broadcast': self.wallet.tx_result = result