Skip to content

Commit 7df6e1b

Browse files
committed
psbt: Fix merging of m_tap_tree
Merging should be checking that the current PSBTOutput doesn't have a taptree and the other one's is copied over. The original merging had this inverted and would remove m_tap_tree if the other did not have it.
1 parent 0652dc5 commit 7df6e1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/psbt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ void PSBTOutput::Merge(const PSBTOutput& output)
265265
if (redeem_script.empty() && !output.redeem_script.empty()) redeem_script = output.redeem_script;
266266
if (witness_script.empty() && !output.witness_script.empty()) witness_script = output.witness_script;
267267
if (m_tap_internal_key.IsNull() && !output.m_tap_internal_key.IsNull()) m_tap_internal_key = output.m_tap_internal_key;
268-
if (m_tap_tree.has_value() && !output.m_tap_tree.has_value()) m_tap_tree = output.m_tap_tree;
268+
if (!m_tap_tree.has_value() && output.m_tap_tree.has_value()) m_tap_tree = output.m_tap_tree;
269269
}
270270
bool PSBTInputSigned(const PSBTInput& input)
271271
{

0 commit comments

Comments
 (0)