electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 27e42b4826f684701d1afc2403aa7bcfcc6a6047
parent 3fc9326c4374af64eb9c294aa754df86adb22ba8
Author: SomberNight <somber.night@protonmail.com>
Date:   Sun, 16 Sep 2018 07:42:25 +0200

interface: if header is on other chain already, just switch (regression)

Diffstat:
Melectrum/interface.py | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/electrum/interface.py b/electrum/interface.py @@ -423,10 +423,13 @@ class Interface(PrintError): assert height <= self.tip, (height, self.tip) if header is None: header = await self.get_block_header(height, 'catchup') - chain = self.blockchain.check_header(header) if 'mock' not in header else header['mock']['check'](header) - if chain: return 'catchup', height+1 - can_connect = blockchain.can_connect(header) if 'mock' not in header else header['mock']['connect'](height) + chain = blockchain.check_header(header) if 'mock' not in header else header['mock']['check'](header) + if chain: + self.blockchain = chain + return 'catchup', height+1 + + can_connect = blockchain.can_connect(header) if 'mock' not in header else header['mock']['connect'](height) if not can_connect: self.print_error("can't connect", height) height, header, bad, bad_header = await self._search_headers_backwards(height, header)