commit e6116db565eac1b3870944132c98c7e9b11bf1a2
parent 96a685a765a673402da4aaddb9bfaf9148f52f4f
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 13 Jul 2017 09:31:27 +0200
network: minor fix
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/network.py b/lib/network.py
@@ -835,7 +835,6 @@ class Network(util.DaemonThread):
if b:
interface.mode = 'default'
interface.blockchain = b
- #interface.print_error('passed checkpoint', b.filename)
self.queue_request('blockchain.headers.subscribe', [], interface)
else:
interface.print_error("checkpoint failed")
@@ -850,12 +849,13 @@ class Network(util.DaemonThread):
interface.print_error("binary search")
next_height = (interface.bad + interface.good) // 2
else:
- interface.bad = height
- delta = interface.tip - height
- next_height = interface.tip - 2 * delta
- if next_height < 0:
- interface.print_error("header didn't connect, dismissing interface")
+ if height == 0:
self.connection_down(interface.server)
+ next_height = None
+ else:
+ interface.bad = height
+ delta = interface.tip - height
+ next_height = max(0, interface.tip - 2 * delta)
elif interface.mode == 'binary':
if can_connect:
interface.good = height