commit 1457a869d39e2281d226686869cde6c18d44c1e3
parent b243772d68ecb0d06fbc533314f4cc362da50dba
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 19 Jul 2017 18:32:48 +0200
network: call switch_lagging after catch up
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/network.py b/lib/network.py
@@ -487,6 +487,7 @@ class Network(util.DaemonThread):
self.switch_to_interface(server)
else:
self.switch_lagging_interface()
+ self.notify('updated')
def switch_to_random_interface(self):
'''Switch to a random connected server other than the current one'''
@@ -505,7 +506,6 @@ class Network(util.DaemonThread):
if filtered:
choice = random.choice(filtered)
self.switch_to_interface(choice)
- self.notify('updated')
def switch_to_interface(self, server):
'''Switch to server as our interface. If no connection exists nor
@@ -879,6 +879,7 @@ class Network(util.DaemonThread):
# exit catch_up state
interface.print_error('catch up done', interface.blockchain.height())
interface.blockchain.catch_up = None
+ self.switch_lagging_interface()
self.notify('updated')
elif interface.mode == 'default':
@@ -979,16 +980,16 @@ class Network(util.DaemonThread):
b = blockchain.check_header(header)
if b:
interface.blockchain = b
- self.notify('interfaces')
self.switch_lagging_interface()
+ self.notify('interfaces')
return
b = blockchain.can_connect(header)
if b:
interface.blockchain = b
b.save_header(header)
+ self.switch_lagging_interface()
self.notify('updated')
self.notify('interfaces')
- self.switch_lagging_interface()
return
tip = max([x.height() for x in self.blockchains.values()])
if tip >=0: