Return EmptyTree instead of OverCompleteTree when there are no scripts

to add
This commit is contained in:
sanket1729 2022-07-28 17:18:57 -07:00
parent ed3fb45c9a
commit 5813ec7ac0
1 changed files with 1 additions and 1 deletions

View File

@ -392,7 +392,7 @@ impl TaprootBuilder {
node_weights.push((Reverse(p), NodeInfo::new_leaf_with_ver(leaf, LeafVersion::TapScript)));
}
if node_weights.is_empty() {
return Err(TaprootBuilderError::IncompleteTree);
return Err(TaprootBuilderError::EmptyTree);
}
while node_weights.len() > 1 {
// Combine the last two elements and insert a new node