Skip to content

Commit

Permalink
TaprootBuilder::has_hidden_nodes method
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 5, 2022
1 parent e69701e commit 56adfa4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/util/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,18 @@ impl TaprootBuilder {
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.
pub fn finalize<C: secp256k1::Verification>(
mut self,
Expand Down

0 comments on commit 56adfa4

Please sign in to comment.