commit 0d05b84dc3234791d73f6aa098d7d799910943b4
parent 02c30e3d520d130866e8edc4cd13eb229a853f49
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:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/electrum/network.py b/electrum/network.py
@@ -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)
@@ -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)
@@ -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