diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-08-16 21:17:43 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2022-10-06 15:32:51 -0400 |
commit | 0577d423adda8e719d7611d03355680c8fbacab8 (patch) | |
tree | 8c89296dd7bd78b876ab1a6592b905f41a82aa6a /src/rpc | |
parent | 22c051ca70bae73e0430b05fb9d879591df27699 (diff) | |
download | bitcoin-0577d423adda8e719d7611d03355680c8fbacab8.tar.xz |
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.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 7ffb499330..b640e5d4ba 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -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); |