diff options
Diffstat (limited to 'src/script/standard.h')
-rw-r--r-- | src/script/standard.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/standard.h b/src/script/standard.h index 285dd4c116..ac4e2f3276 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -327,4 +327,12 @@ public: TaprootSpendData GetSpendData() const; }; +/** Given a TaprootSpendData and the output key, reconstruct its script tree. + * + * If the output doesn't match the spenddata, or if the data in spenddata is incomplete, + * std::nullopt is returned. Otherwise, a vector of (depth, script, leaf_ver) tuples is + * returned, corresponding to a depth-first traversal of the script tree. + */ +std::optional<std::vector<std::tuple<int, CScript, int>>> InferTaprootTree(const TaprootSpendData& spenddata, const XOnlyPubKey& output); + #endif // BITCOIN_SCRIPT_STANDARD_H |