tnetwork: handle reorg (sooner) in case of multiple forks at given height (#4537) - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 0d05b84dc3234791d73f6aa098d7d799910943b4 DIR parent 02c30e3d520d130866e8edc4cd13eb229a853f49 HTML Author: ghost43 <somber.night@protonmail.com> Date: Sun, 29 Jul 2018 03:56:10 +0200 network: handle reorg (sooner) in case of multiple forks at given height (#4537) Diffstat: M electrum/network.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/network.py b/electrum/network.py t@@ -897,6 +897,7 @@ class Network(util.DaemonThread): self.connection_down(interface.server) return height = header.get('block_height') + #interface.print_error('got header', height, blockchain.hash_header(header)) if interface.request != height: interface.print_error("unsolicited header",interface.request, height) self.connection_down(interface.server) t@@ -952,7 +953,7 @@ class Network(util.DaemonThread): elif branch.parent().check_header(header): interface.print_error('reorg', interface.bad, interface.tip) interface.blockchain = branch.parent() - next_height = None + next_height = interface.bad else: interface.print_error('checkpoint conflicts with existing fork', branch.path()) branch.write(b'', 0) t@@ -1086,6 +1087,7 @@ class Network(util.DaemonThread): except InvalidHeader: self.connection_down(interface.server) return + #interface.print_error('notified of header', height, blockchain.hash_header(header)) if height < self.max_checkpoint(): self.connection_down(interface.server) return