Skip to content

Commit

Permalink
Merge pull request #76 from BP-WG/fix/master_fp
Browse files Browse the repository at this point in the history
Fix key source for accounts without master fingerprint
  • Loading branch information
dr-orlovsky authored Mar 20, 2024
2 parents 9851b2f + 37a5678 commit 57d1b0d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions hd/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ impl DerivationAccount {
) -> Result<DerivationPath, DerivePatternError> {
let mut derivation_path =
Vec::with_capacity(self.account_path.len() + self.terminal_path.len() + 1);
if self.master.is_some() {
derivation_path.extend(self.account_path.iter().map(ChildNumber::from));
}
derivation_path.extend(self.account_path.iter().map(ChildNumber::from));
derivation_path.extend(&self.to_terminal_derivation_path(pat)?);
Ok(derivation_path.into())
}
Expand All @@ -236,8 +234,7 @@ impl DerivationAccount {
Ok((
self.derive_public_key(ctx, pat.clone())?,
(
self.master_fingerprint()
.unwrap_or_else(|| self.account_fingerprint()),
self.master_fingerprint().unwrap_or_default(),
self.to_full_derivation_path(pat)?,
),
))
Expand Down

0 comments on commit 57d1b0d

Please sign in to comment.