Browse Source

Merge remote-tracking branch 'upstream/master'

283
Pontius 12 years ago
parent
commit
344cb1ddb1
  1. 28
      TODOLIST
  2. 3
      electrum
  3. 10
      lib/gui_qt.py
  4. 34
      lib/interface.py

28
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

3
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)

10
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) )
@ -1490,19 +1491,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)

34
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

Loading…
Cancel
Save