From dc83db273aa348e4070d31c7b772c306d5b200e9 Mon Sep 17 00:00:00 2001 From: davemo88 Date: Thu, 11 Mar 2021 21:54:00 -0500 Subject: [PATCH] better derivation path building --- src/wallet/signer.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/wallet/signer.rs b/src/wallet/signer.rs index 3ff02425..16f9af30 100644 --- a/src/wallet/signer.rs +++ b/src/wallet/signer.rs @@ -225,18 +225,8 @@ impl Signer for DescriptorXKey { let derived_key = match self.origin.clone() { Some((_fingerprint, origin_path)) => { let deriv_path = DerivationPath::from( - full_path - .into_iter() - .enumerate() - .filter_map(|(i, child)| { - if i >= origin_path.len() { - Some(child) - } else { - None - } - }) - .cloned() - .collect::>(), + &full_path.into_iter().cloned().collect::>() + [origin_path.len()..], ); self.xkey.derive_priv(&secp, &deriv_path).unwrap() }