tdon't request headers beyond tip - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 637d52ce581deaa3d16ffe0066b6dd6dc9c6d664 DIR parent 214e2b89c2ca3aa0497c71ec5bda43fa8d2d3497 HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 18 Jul 2017 14:11:22 +0200 don't request headers beyond tip Diffstat: M lib/network.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/network.py b/lib/network.py t@@ -833,7 +833,6 @@ class Network(util.DaemonThread): if interface.bad != interface.good + 1: next_height = (interface.bad + interface.good) // 2 else: - interface.print_error("can connect at %d"% interface.bad) branch = self.blockchains.get(interface.bad) if branch is not None: if branch.check_header(interface.bad_header): t@@ -854,9 +853,11 @@ class Network(util.DaemonThread): else: assert interface.blockchain.height() == interface.good - if interface.blockchain.catch_up is None: + bh = interface.blockchain.height() + if interface.blockchain.catch_up is None and bh < interface.tip: + interface.print_error("catching up from %d"% (bh + 1)) interface.mode = 'catch_up' - next_height = interface.blockchain.height() + 1 + next_height = bh + 1 interface.blockchain.catch_up = interface.server else: interface.print_error('already catching up')