Browse Source

update servers list every 5 minutes

283
thomasv 13 years ago
parent
commit
4843c4dd3a
  1. 10
      client/gui.py

10
client/gui.py

@ -460,16 +460,19 @@ class BitcoinGUI:
try:
self.wallet.new_session()
self.is_connected = True
self.info.set_text( self.wallet.message)
except:
self.is_connected = False
traceback.print_exc(file=sys.stdout)
time.sleep(self.period)
continue
get_servers_time = 0
while True:
if time.time() - get_servers_time > 5*60:
wallet.get_servers()
self.info.set_text( self.wallet.message)
get_servers_time = time.time()
while True:
self.period = 15 if self.wallet.use_http() else 5
try:
u = self.wallet.update()
@ -953,11 +956,10 @@ class BitcoinGUI:
def network_dialog( self, w ):
wallet = self.wallet
image = gtk.Image()
if self.is_connected:
image.set_from_stock(gtk.STOCK_NETWORK, gtk.ICON_SIZE_DIALOG)
if self.is_connected:
status = "Connected to %s.\n%d blocks\nresponse time: %f"%(wallet.host, wallet.blocks, wallet.rtime)
else:
image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_DIALOG)
status = "Not connected"
dialog = gtk.MessageDialog( self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,

Loading…
Cancel
Save