diff --git a/src/util/psbt/serialize.rs b/src/util/psbt/serialize.rs index 09fc8c7a..e026f0d5 100644 --- a/src/util/psbt/serialize.rs +++ b/src/util/psbt/serialize.rs @@ -355,7 +355,7 @@ impl Deserialize for TapTree { builder = builder.add_leaf_with_ver(*depth, script, leaf_version) .map_err(|_| encode::Error::ParseFailed("Tree not in DFS order"))?; } - if builder.is_finalized() || !builder.has_hidden_nodes() { + if builder.is_finalized() && !builder.has_hidden_nodes() { Ok(TapTree(builder)) } else { Err(encode::Error::ParseFailed("Incomplete taproot Tree"))