Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix derivable-descriptor detection during wallet sync #692

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/blockchain/script_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ impl<'a, D: BatchDatabase> ScriptReq<'a, D> {
let current_gap = self.script_index - last;

// this is a hack to check whether the scripts are coming from a derivable descriptor
// we assume for non-derivable descriptors, the initial script count is always 1
let is_derivable = self.initial_scripts_needed > 1;
// we assume for non-derivable descriptors, the initial script count is always 1 and
// as we are working with (at-most) 2 descriptors, we use 2 to determine derivability
let is_derivable = self.initial_scripts_needed > 2;

debug!(
"sync: last={}, remaining={}, diff={}, stop_gap={}",
Expand Down