Skip to content

Commit 5fad4bf

Browse files
committed
verifier: fix off-by-one for max_checkpoint
if a wallet had a tx mined in the max_checkpoint block, in certain cases we would leave it forever in the "unverified" state and remain stuck in "synchronizing..."
1 parent 68a2033 commit 5fad4bf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

electrum/lnverifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ async def _verify_some_channels(self):
101101
continue
102102
header = blockchain.read_header(block_height)
103103
if header is None:
104-
if block_height < constants.net.max_checkpoint():
105-
await self.taskgroup.spawn(self.network.request_chunk(block_height, can_return_early=True))
104+
if block_height <= constants.net.max_checkpoint():
105+
await self.taskgroup.spawn(self.interface.request_chunk(block_height, can_return_early=True))
106106
continue
107107
self.started_verifying_channel.add(short_channel_id)
108108
await self.taskgroup.spawn(self.verify_channel(block_height, short_channel_id))

electrum/verifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async def _request_proofs(self):
8686
# if it's in the checkpoint region, we still might not have the header
8787
header = self.blockchain.read_header(tx_height)
8888
if header is None:
89-
if tx_height < constants.net.max_checkpoint():
89+
if tx_height <= constants.net.max_checkpoint():
9090
# FIXME these requests are not counted (self._requests_sent += 1)
9191
await self.taskgroup.spawn(self.interface.request_chunk(tx_height, can_return_early=True))
9292
continue

0 commit comments

Comments
 (0)