]> Untitled Git - bdk/commit
esplora: fix incorrect gap limit check in blocking client
authorAntoine Poinsot <darosior@protonmail.com>
Mon, 20 Nov 2023 09:34:10 +0000 (10:34 +0100)
committerAntoine Poinsot <darosior@protonmail.com>
Fri, 24 Nov 2023 11:21:12 +0000 (12:21 +0100)
commit18bd3296170e64aee6870cd96dde52a0078bbcb1
treedac7a27bd314186b65c06e1130e24513c42832b0
parent9e681b39fb2e5b81d47599a1bd56e22d6ba4b100
esplora: fix incorrect gap limit check in blocking client

The gap limit was checked such as if the last_index was not None but the
last_active_index was, we'd consider having reached it. But the
last_index is never None for this check. This effectively made it so the
gap limit was always 1: if the first address isn't used
last_active_index will be None and we'd return immediately.

Fix this by avoiding error-prone Option comparisons and correctly
checking we've reached the gap limit before breaking out of the loop.
crates/esplora/src/blocking_ext.rs