From 40509b7c613a99d5009a9c616b275e00b33130ec Mon Sep 17 00:00:00 2001 From: thomasv Date: Thu, 3 Jan 2013 18:54:34 +0100 Subject: [PATCH 1/4] todolist --- TODOLIST | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 TODOLIST diff --git a/TODOLIST b/TODOLIST new file mode 100644 index 000000000..08b1d6f8c --- /dev/null +++ b/TODOLIST @@ -0,0 +1,28 @@ + +security: + - check that we are on the longest chain after a reorg + - check SSL cerfificates of servers + + +wallet, transactions : + - support compressed keys + - dust sweeping + - transactions with multiple outputs + - BIP 32 + + +code improvements: + - qrcode and bmp patches are on github (they are incompatible with android) + + +classic gui : + - in POS mode, request amount in USD, convert to BTC + + +android: + - kivy-based gui + + +protocol: + - add client authentication, to make paying servers possible + From 3bae4e9761dbca3454b6fafe4c5974eae2c23893 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 3 Jan 2013 20:13:23 +0100 Subject: [PATCH 2/4] remove unnecessary clutter --- lib/gui_qt.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/gui_qt.py b/lib/gui_qt.py index 9ed25d259..51b66f110 100644 --- a/lib/gui_qt.py +++ b/lib/gui_qt.py @@ -1490,19 +1490,10 @@ class ElectrumWindow(QMainWindow): d.setWindowTitle(_('Electrum Settings')) d.setModal(1) vbox = QVBoxLayout() - msg = _('Here are the settings of your wallet.') + '\n'\ - + _('For more explanations, click on the help buttons next to each field.') - - label = QLabel(msg) - label.setFixedWidth(250) - label.setWordWrap(True) - label.setAlignment(Qt.AlignJustify) tabs = QTabWidget(self) vbox.addWidget(tabs) - vbox.addWidget(label) - tab = QWidget() grid_wallet = QGridLayout(tab) grid_wallet.setColumnStretch(0,1) From 512a812872bf7e0183e416fbbdac9e330aec5371 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 3 Jan 2013 21:36:25 +0100 Subject: [PATCH 3/4] try http if tcp fails. --- electrum | 3 ++- lib/interface.py | 34 ++++++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/electrum b/electrum index 83a5869a0..3f134d9d2 100755 --- a/electrum +++ b/electrum @@ -205,7 +205,8 @@ if __name__ == '__main__': interface = Interface(config, True) wallet.interface = interface interface.start() - interface.send([('server.peers.subscribe',[])]) + if interface.is_connected: + interface.send([('server.peers.subscribe',[])]) set_language(config.get('language')) gui = gui.ElectrumGui(wallet, config) diff --git a/lib/interface.py b/lib/interface.py index 32610221b..e9a37c8f0 100644 --- a/lib/interface.py +++ b/lib/interface.py @@ -39,6 +39,11 @@ DEFAULT_SERVERS = [ 'ecdsa.org:50001:t' ] +# add only port 80 servers here +DEFAULT_HTTP_SERVERS = [ + 'electrum.no-ip.org:80:h' +] + proxy_modes = ['socks4', 'socks5', 'http'] @@ -174,7 +179,14 @@ class Interface(threading.Thread): self.init_server(host, port, proxy, use_ssl) self.session_id = None self.connection_msg = ('https' if self.use_ssl else 'http') + '://%s:%d'%( self.host, self.port ) - self.is_connected = True + try: + self.poll() + except: + return + + if self.session_id: + print_error('http session:',self.session_id) + self.is_connected = True def run_http(self): self.is_connected = True @@ -232,7 +244,7 @@ class Interface(threading.Thread): headers['cookie'] = 'SESSION=%s'%self.session_id req = urllib2.Request(self.connection_msg, data_json, headers) - response_stream = urllib2.urlopen(req) + response_stream = urllib2.urlopen(req, timeout=DEFAULT_TIMEOUT) for index, cookie in enumerate(cj): if cookie.name=='SESSION': @@ -389,17 +401,23 @@ class Interface(threading.Thread): if not self.is_connected and self.config.get('auto_cycle'): print_msg("Using random server...") - servers = DEFAULT_SERVERS[:] - while servers: - server = random.choice( servers ) - servers.remove(server) + servers_tcp = DEFAULT_SERVERS[:] + servers_http = DEFAULT_HTTP_SERVERS[:] + while servers_tcp or servers_http: + if servers_tcp: + server = random.choice( servers_tcp ) + servers_tcp.remove(server) + else: + # try HTTP if we can't get a TCP connection + server = random.choice( servers_http ) + servers_http.remove(server) + print server self.config.set_key('server', server, False) self.init_with_server(self.config) if self.is_connected: break - if not servers: + if not self.is_connected: print 'no server available' - self.is_connected = False self.connect_event.set() # to finish start self.server = 'ecdsa.org:50001:t' self.proxy = None From 2ae5f0940a3075e80a5e2d87804a1c325380860a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 3 Jan 2013 23:59:43 +0100 Subject: [PATCH 4/4] update status bar when amount is modified --- lib/gui_qt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gui_qt.py b/lib/gui_qt.py index 51b66f110..077e87362 100644 --- a/lib/gui_qt.py +++ b/lib/gui_qt.py @@ -705,6 +705,7 @@ class ElectrumWindow(QMainWindow): self.funds_error = True self.amount_e.setPalette(palette) self.fee_e.setPalette(palette) + self.update_wallet() self.amount_e.textChanged.connect(lambda: entry_changed(False) ) self.fee_e.textChanged.connect(lambda: entry_changed(True) )