Skip to content

Commit cdb57cb

Browse files
committed
Make TapTree::combine public
While upgrading `bdk` to use bitcoin v0.31.0-rc1 and a patched version of miniscript with the same upgrade it was found that the `TapTree::combine` function could be used. Without this function users are required to do the height calculation themselves.
1 parent 29b612c commit cdb57cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/descriptor/tr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<Pk: MiniscriptKey> hash::Hash for Tr<Pk> {
118118

119119
impl<Pk: MiniscriptKey> TapTree<Pk> {
120120
/// Creates a `TapTree` by combining `left` and `right` tree nodes.
121-
pub(crate) fn combine(left: TapTree<Pk>, right: TapTree<Pk>) -> Self {
121+
pub fn combine(left: TapTree<Pk>, right: TapTree<Pk>) -> Self {
122122
let height = 1 + cmp::max(left.height(), right.height());
123123
TapTree::Tree { left: Arc::new(left), right: Arc::new(right), height }
124124
}

0 commit comments

Comments
 (0)