MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / BuildBack

Function BuildBack

src/script/miniscript.h:1839–1848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1837/** BuildBack pops the last two elements off `constructed` and wraps them in the specified Fragment */
1838template<typename Key>
1839void BuildBack(const MiniscriptContext script_ctx, Fragment nt, std::vector<Node<Key>>& constructed, const bool reverse = false)
1840{
1841 Node<Key> child{std::move(constructed.back())};
1842 constructed.pop_back();
1843 if (reverse) {
1844 constructed.back() = Node<Key>{internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(child), std::move(constructed.back()))};
1845 } else {
1846 constructed.back() = Node<Key>{internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(constructed.back()), std::move(child))};
1847 }
1848}
1849
1850/**
1851 * Parse a miniscript from its textual descriptor form.

Callers 2

ParseFunction · 0.85
DecodeScriptFunction · 0.85

Calls 3

VectorFunction · 0.85
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected