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

Method MiniscriptDescriptor

src/script/descriptor.cpp:1690–1708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1688
1689public:
1690 MiniscriptDescriptor(std::vector<std::unique_ptr<PubkeyProvider>> providers, miniscript::Node<uint32_t>&& node)
1691 : DescriptorImpl(std::move(providers), "?"), m_node(std::move(node))
1692 {
1693 // Traverse miniscript tree for unsafe use of older()
1694 miniscript::ForEachNode(m_node, [&](const miniscript::Node<uint32_t>& node) {
1695 if (node.Fragment() == miniscript::Fragment::OLDER) {
1696 const uint32_t raw = node.K();
1697 const uint32_t value_part = raw & ~CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG;
1698 if (value_part > CTxIn::SEQUENCE_LOCKTIME_MASK) {
1699 const bool is_time_based = (raw & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) != 0;
1700 if (is_time_based) {
1701 m_warnings.push_back(strprintf("time-based relative locktime: older(%u) > (65535 * 512) seconds is unsafe", raw));
1702 } else {
1703 m_warnings.push_back(strprintf("height-based relative locktime: older(%u) > 65535 blocks is unsafe", raw));
1704 }
1705 }
1706 }
1707 });
1708 }
1709
1710 bool ToStringHelper(const SigningProvider* arg, std::string& out, const StringType type,
1711 const DescriptorCache* cache = nullptr) const override

Callers

nothing calls this directly

Calls 4

ForEachNodeFunction · 0.85
FragmentMethod · 0.80
KMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected