-
-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Milestone
Description
To prevent situations like this:
descriptor-wallet/descriptors/src/derive.rs
Lines 63 to 76 in bc7a08d
| /// Creates scriptPubkey for specific derive pattern in pre-taproot | |
| /// descriptors | |
| fn script_pubkey_pretr<C: Verification>( | |
| &self, | |
| secp: &Secp256k1<C>, | |
| pat: impl AsRef<[UnhardenedIndex]>, | |
| ) -> Result<Script, DeriveError>; | |
| /// Creates scriptPubkey for specific derive pattern in taproot descriptors | |
| fn script_pubkey_tr<C: Verification>( | |
| &self, | |
| secp: &Secp256k1<C>, | |
| pat: impl AsRef<[UnhardenedIndex]>, | |
| ) -> Result<Script, DeriveError>; |
and like this, where a potential bugs may happen:
descriptor-wallet/onchain/src/resolvers/mod.rs
Lines 119 to 130 in bc7a08d
| let scripts = indexes | |
| .into_iter() | |
| .map(|index| { | |
| if let Some(i) = derivation.borrow_mut().last_mut() { | |
| *i = index | |
| } | |
| Ok(( | |
| index, | |
| descriptor.script_pubkey_pretr(secp, &*derivation.borrow())?, | |
| )) | |
| }) | |
| .collect::<Result<BTreeMap<_, _>, DeriveError>>()?; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo