From 09dfb0fd1da16c4660f50607ab559297044b363b Mon Sep 17 00:00:00 2001 From: Janus Date: Tue, 11 Sep 2018 17:16:37 +0200 Subject: [PATCH] fix off-by-one error when syncing from genesis w/o checkpoints --- electrum/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/interface.py b/electrum/interface.py index bac6f59f6..e35890004 100644 --- a/electrum/interface.py +++ b/electrum/interface.py @@ -381,7 +381,7 @@ class Interface(PrintError): height -= 1 checkp = False if height <= constants.net.max_checkpoint(): - height = constants.net.max_checkpoint() + 1 + height = constants.net.max_checkpoint() checkp = True header = await self.get_block_header(height, 'backward') @@ -396,7 +396,7 @@ class Interface(PrintError): next_height = self.tip - 2 * delta checkp = False if next_height <= constants.net.max_checkpoint(): - next_height = constants.net.max_checkpoint() + 1 + next_height = constants.net.max_checkpoint() checkp = True height = next_height