1
0

slightly more robust connection procedure

This commit is contained in:
thomasv
2012-05-16 17:29:05 +02:00
parent 94cc6aa93a
commit c5d42f3614
4 changed files with 30 additions and 25 deletions

View File

@@ -1140,7 +1140,7 @@ class ElectrumWindow:
interface = self.wallet.interface
if self.funds_error:
text = "Not enough funds"
elif interface.is_connected:
elif interface and interface.is_connected:
self.network_button.set_tooltip_text("Connected to %s:%d.\n%d blocks"%(interface.host, interface.port, self.wallet.blocks))
if self.wallet.blocks == -1:
self.status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU)
@@ -1159,7 +1159,7 @@ class ElectrumWindow:
if u: text += "[%s unconfirmed]"%( format_satoshis(u,True,self.wallet.num_zeros).strip() )
else:
self.status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU)
self.network_button.set_tooltip_text("Trying to contact %s.\n%d blocks"%(interface.host, self.wallet.blocks))
self.network_button.set_tooltip_text("Trying to contact %s.\n%d blocks"%(self.wallet.server, self.wallet.blocks))
text = "Not connected"
self.status_bar.pop(self.context_id)