aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-10-06 15:19:30 -0400
committerfanquake <fanquake@gmail.com>2022-10-13 23:44:01 +0800
commit4abd2ab18e26999e2dafcb15a58a7979de90af34 (patch)
tree4bb0f0aa4e6e7229dbd14107f3a6aa15896b3abe
parent1390c96c8e9c56e0d8348ef056f18e3e04f0f63f (diff)
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. Github-Pull: #25858 Rebased-From: 7df6e1bb77a96eac4fbcba424bbe780636b86650
-rw-r--r--src/psbt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp
index 36fec74bc9..6b75de91f8 100644
--- a/src/psbt.cpp
+++ b/src/psbt.cpp
@@ -265,7 +265,7 @@ void PSBTOutput::Merge(const PSBTOutput& output)
if (redeem_script.empty() && !output.redeem_script.empty()) redeem_script = output.redeem_script;
if (witness_script.empty() && !output.witness_script.empty()) witness_script = output.witness_script;
if (m_tap_internal_key.IsNull() && !output.m_tap_internal_key.IsNull()) m_tap_internal_key = output.m_tap_internal_key;
- if (m_tap_tree.has_value() && !output.m_tap_tree.has_value()) m_tap_tree = output.m_tap_tree;
+ if (!m_tap_tree.has_value() && output.m_tap_tree.has_value()) m_tap_tree = output.m_tap_tree;
}
bool PSBTInputSigned(const PSBTInput& input)
{