From 5813ec7ac078f1af67efdc878506a430014173ef Mon Sep 17 00:00:00 2001 From: sanket1729 Date: Thu, 28 Jul 2022 17:18:57 -0700 Subject: [PATCH] Return EmptyTree instead of OverCompleteTree when there are no scripts to add --- src/util/taproot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/taproot.rs b/src/util/taproot.rs index dca69e6083..aaa2b0e99c 100644 --- a/src/util/taproot.rs +++ b/src/util/taproot.rs @@ -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