Skip to content

Commit a9b1063

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#950: Fix TapTree derserialization
c97589f Fix TapTree derserialization (sanket1729) Pull request description: Trees should only be serialized if both of the following conditions hold: 1) Tree is complete binary tree(is_finalized) 2) Tree does not have any hidden nodes ACKs for top commit: tcharding: ACK c97589f apoelstra: ACK c97589f Tree-SHA512: 33d16f2d532cb24acba4ab847d493e550f7b279567678f3f2cd7e4161dea8b720a0e35be32b6c506e467c3526a29042aad8f4b5f45133b9a32028d4ee6a48f8e
2 parents dffff2e + 2f5a46e commit a9b1063

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/psbt/serialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl Deserialize for TapTree {
355355
builder = builder.add_leaf_with_ver(*depth, script, leaf_version)
356356
.map_err(|_| encode::Error::ParseFailed("Tree not in DFS order"))?;
357357
}
358-
if builder.is_finalized() || !builder.has_hidden_nodes() {
358+
if builder.is_finalized() && !builder.has_hidden_nodes() {
359359
Ok(TapTree(builder))
360360
} else {
361361
Err(encode::Error::ParseFailed("Incomplete taproot Tree"))

0 commit comments

Comments
 (0)