mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 19:47:30 -03:00
psbt: Only include m_tap_tree if it has scripts
Github-Pull: #25858
Rebased-From: 30ff25cf37
This commit is contained in:
parent
d810fde8ea
commit
4d42c3a240
2 changed files with 3 additions and 1 deletions
|
@ -249,7 +249,7 @@ void PSBTOutput::FromSignatureData(const SignatureData& sigdata)
|
|||
if (!sigdata.tr_spenddata.internal_key.IsNull()) {
|
||||
m_tap_internal_key = sigdata.tr_spenddata.internal_key;
|
||||
}
|
||||
if (sigdata.tr_builder.has_value()) {
|
||||
if (sigdata.tr_builder.has_value() && sigdata.tr_builder->HasScripts()) {
|
||||
m_tap_tree = sigdata.tr_builder->GetTreeTuples();
|
||||
}
|
||||
for (const auto& [pubkey, leaf_origin] : sigdata.taproot_misc_pubkeys) {
|
||||
|
|
|
@ -315,6 +315,8 @@ public:
|
|||
TaprootSpendData GetSpendData() const;
|
||||
/** Returns a vector of tuples representing the depth, leaf version, and script */
|
||||
std::vector<std::tuple<uint8_t, uint8_t, CScript>> GetTreeTuples() const;
|
||||
/** Returns true if there are any tapscripts */
|
||||
bool HasScripts() const { return !m_branch.empty(); }
|
||||
};
|
||||
|
||||
/** Given a TaprootSpendData and the output key, reconstruct its script tree.
|
||||
|
|
Loading…
Add table
Reference in a new issue