Browse Source

handle disconnects

283
ThomasV 13 years ago
parent
commit
94b4ad8be7
  1. 2
      client/gui.py
  2. 7
      client/interface.py

2
client/gui.py

@ -1039,7 +1039,7 @@ class ElectrumWindow:
if self.wallet.interface.blocks == 0:
self.status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU)
text = "Server not ready"
elif not self.wallet.interface.was_polled:
elif not self.wallet.interface.is_up_to_date:
self.status_image.set_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_MENU)
text = "Synchronizing..."
else:

7
client/interface.py

@ -221,6 +221,9 @@ class TCPInterface(Interface):
while True:
msg = self.s.recv(1024)
out += msg
if msg == '':
self.is_connected = False
raise BaseException('Socket was disconnected')
while True:
s = out.find('\n')
if s==-1: break
@ -230,9 +233,9 @@ class TCPInterface(Interface):
cmd = c.get('method')
if cmd == 'server.banner':
self.message = c.get('result')
if cmd == 'numblocks.subscribe':
elif cmd == 'numblocks.subscribe':
self.blocks = c.get('result')
print "received numblocks",self.blocks
print "num blocks",self.blocks
elif cmd =='address.subscribe':
addr = c.get('address')
status = c.get('status')

Loading…
Cancel
Save