1
0

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:
SomberNight
2018-09-19 21:56:09 +02:00
parent cbd91ba5b1
commit 855a70bc66
4 changed files with 14 additions and 2 deletions

View File

@@ -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):