aboutsummaryrefslogtreecommitdiff
path: root/src/script/standard.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-07-12 17:04:46 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-06-27 16:47:48 -0400
commitd43923c38155fdadad3837d79c19a84c9d2d7f50 (patch)
treef5149f49e948a4ad2585ab51053ec4d08d736224 /src/script/standard.h
parentce911204e42b8653cad791d1727aa625de9d0079 (diff)
downloadbitcoin-d43923c38155fdadad3837d79c19a84c9d2d7f50.tar.xz
Add TaprootBuilder::GetTreeTuples
GetTreeTuples returns the leaves in DFS order as tuples of depth, leaf version, and script. This is a representation of the tree that can be serialized.
Diffstat (limited to 'src/script/standard.h')
-rw-r--r--src/script/standard.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/standard.h b/src/script/standard.h
index 6a15ba4e3d..448fdff010 100644
--- a/src/script/standard.h
+++ b/src/script/standard.h
@@ -322,6 +322,8 @@ public:
static bool ValidDepths(const std::vector<int>& depths);
/** Compute spending data (after Finalize()). */
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;
};
/** Given a TaprootSpendData and the output key, reconstruct its script tree.