network: new trigger 'blockchain_updated'
follow-up af63913189
needed to update history tab when new blocks come,
to refresh the number of confirmations (icons/tooltips)
This commit is contained in:
@@ -589,7 +589,9 @@ class Network(PrintError):
|
||||
i = self.interfaces[server]
|
||||
if self.interface != i:
|
||||
self.print_error("switching to", server)
|
||||
blockchain_updated = False
|
||||
if self.interface is not None:
|
||||
blockchain_updated = i.blockchain != self.interface.blockchain
|
||||
# Stop any current interface in order to terminate subscriptions,
|
||||
# and to cancel tasks in interface.group.
|
||||
# However, for headers sub, give preference to this interface
|
||||
@@ -605,6 +607,7 @@ class Network(PrintError):
|
||||
self.trigger_callback('default_server_changed')
|
||||
self.set_status('connected')
|
||||
self.trigger_callback('network_updated')
|
||||
if blockchain_updated: self.trigger_callback('blockchain_updated')
|
||||
|
||||
@with_interface_lock
|
||||
def close_interface(self, interface):
|
||||
|
||||
Reference in New Issue
Block a user