tfix: handle multiple forks at same checkpoint - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit d5d5e8af5c77760e8e20a5565388b9acc337279b DIR parent 732679aa3dd8eab99f1d77e1e5644fe6b3105066 HTML Author: ThomasV <thomasv@electrum.org> Date: Mon, 24 Jul 2017 08:46:49 +0200 fix: handle multiple forks at same checkpoint Diffstat: M lib/network.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/network.py b/lib/network.py t@@ -835,13 +835,19 @@ class Network(util.DaemonThread): if branch is not None: if branch.check_header(interface.bad_header): interface.print_error('joining chain', interface.bad) + next_height = None elif branch.parent().check_header(header): interface.print_error('reorg', interface.bad, interface.tip) interface.blockchain = branch.parent() + next_height = None else: - # should not happen - raise BaseException('error') - next_height = None + interface.print_error('checkpoint conflicts with existing fork', branch.path()) + open(branch.path(), 'w+').close() + branch.save_header(interface.bad_header) + interface.mode = 'catch_up' + interface.blockchain = branch + next_height = interface.bad + 1 + interface.blockchain.catch_up = interface.server else: bh = interface.blockchain.height() next_height = None