mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
psbt: Change m_tap_tree to store just the tuples
Instead of having an entire TaprootBuilder which may or may not be complete, and could potentially have future changes that interact oddly with taproot tree tuples, have m_tap_tree be just the tuples. When needed in other a TaprootBuilder for actual use, the tuples will be added to a a TaprootBuilder that, in the future, can take in whatever other data is needed as well.
This commit is contained in:
@@ -1241,13 +1241,9 @@ static RPCHelpMan decodepsbt()
|
||||
}
|
||||
|
||||
// Taproot tree
|
||||
if (output.m_tap_tree.has_value()) {
|
||||
if (!output.m_tap_tree.empty()) {
|
||||
UniValue tree(UniValue::VARR);
|
||||
const auto& tuples = output.m_tap_tree->GetTreeTuples();
|
||||
for (const auto& tuple : tuples) {
|
||||
uint8_t depth = std::get<0>(tuple);
|
||||
uint8_t leaf_ver = std::get<1>(tuple);
|
||||
CScript script = std::get<2>(tuple);
|
||||
for (const auto& [depth, leaf_ver, script] : output.m_tap_tree) {
|
||||
UniValue elem(UniValue::VOBJ);
|
||||
elem.pushKV("depth", (int)depth);
|
||||
elem.pushKV("leaf_ver", (int)leaf_ver);
|
||||
|
||||
Reference in New Issue
Block a user