Skip to content

Commit

Permalink
hd: fix key source for accounts without master fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Sep 12, 2023
1 parent 3525ada commit 37a5678
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 37a5678

Please sign in to comment.