commit 1bb1fc37f418a787e986e41b976a98e646d83e48
parent c42f0dac53e7d1e27c443b20c51d5d68e8ff8acd
Author: SomberNight <somber.night@protonmail.com>
Date: Thu, 30 Aug 2018 19:25:42 +0200
network: don't ask for block -1 if server is on wrong chain
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/electrum/network.py b/electrum/network.py
@@ -1020,11 +1020,14 @@ class Network(util.DaemonThread):
raise Exception(interface.mode)
# If not finished, get the next header
if next_height is not None:
- if interface.mode == 'catch_up' and interface.tip > next_height + 50:
+ if next_height < 0:
+ self.connection_down(interface.server)
+ next_height = None
+ elif interface.mode == 'catch_up' and interface.tip > next_height + 50:
self.request_chunk(interface, next_height // 2016)
else:
self.request_header(interface, next_height)
- else:
+ if next_height is None:
interface.mode = 'default'
interface.request = None
self.notify('updated')