TaprootBuilder::has_hidden_nodes method

This commit is contained in:
Dr Maxim Orlovsky 2022-04-01 08:06:18 +02:00
parent e69701e089
commit 56adfa4527
No known key found for this signature in database
GPG Key ID: FFC0250947E5C6F7
1 changed files with 12 additions and 0 deletions

View File

@ -466,6 +466,18 @@ impl TaprootBuilder {
self.branch.len() == 1 && self.branch[0].is_some() self.branch.len() == 1 && self.branch[0].is_some()
} }
/// Checks if the builder has hidden nodes.
pub fn has_hidden_nodes(&self) -> bool {
for node in &self.branch {
if let Some(node) = node {
if node.has_hidden_nodes {
return true
}
}
}
false
}
/// Creates a [`TaprootSpendInfo`] with the given internal key. /// Creates a [`TaprootSpendInfo`] with the given internal key.
pub fn finalize<C: secp256k1::Verification>( pub fn finalize<C: secp256k1::Verification>(
mut self, mut self,