Skip to content

Commit 5813ec7

Browse files
committed
Return EmptyTree instead of OverCompleteTree when there are no scripts
to add
1 parent ed3fb45 commit 5813ec7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/taproot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ impl TaprootBuilder {
392392
node_weights.push((Reverse(p), NodeInfo::new_leaf_with_ver(leaf, LeafVersion::TapScript)));
393393
}
394394
if node_weights.is_empty() {
395-
return Err(TaprootBuilderError::IncompleteTree);
395+
return Err(TaprootBuilderError::EmptyTree);
396396
}
397397
while node_weights.len() > 1 {
398398
// Combine the last two elements and insert a new node

0 commit comments

Comments
 (0)