]> Untitled Git - bdk-cli/commit
fix(full_scan): gate --scan-stop-gap to backends that use it
authoremma31-dev <emmanuelfidel07@gmail.com>
Tue, 10 Nov 2026 11:16:59 +0000 (12:16 +0100)
committeremma31-dev <emmanuelfidel07@gmail.com>
Tue, 10 Nov 2026 11:21:35 +0000 (12:21 +0100)
commitb6e54bf221f97a81167d33312f5305ebdca6a121
tree53f80988236cde25be568dc59dd6ebc8a8c73303
parent9ba78013bdfab7c268b6575442e881db63c242cb
fix(full_scan): gate --scan-stop-gap to backends that use it

The RPC and CBF backends never use `stop_gap`, so accepting the flag silently
ignored it. Gate the option to the Electrum and Esplora backends and reject it
at runtime for RPC and CBF wallets in multi-backend builds, where the backend is
chosen from the wallet config rather than at compile time.

Read `STOP_GAP` in the handler rather than through clap so that a globally
exported value no longer turns an RPC or CBF scan into an error when the flag
was never passed, while supported backends keep the environment behaviour.

Keep the default of 20 in one place (`DEFAULT_STOP_GAP`) and document it, with
the env var, in `--help`.

Related to #340.
CHANGELOG.md
src/handlers/online.rs