Add a new script at a certain depth in the tree. Add() operations must be called in depth-first traversal order of binary tree. If track is true, it will be included in the GetSpendData() output.
Declared in <script/signingprovider.h>
TaprootBuilder&
Add(
int depth,
std::span<unsigned char const> script,
int leaf_version,
bool track = true);
A reference to this builder for chaining.
| Name | Description |
|---|---|
| depth | The depth in the Merkle tree to add the script at. |
| script | The script to add as a tapscript leaf. |
| leaf_version | The tapscript leaf version for the script. |
| track | Whether to include the leaf in the GetSpendData() output. |