| 2307 | } |
| 2308 | |
| 2309 | template<typename I> std::optional<Key> FromPKHBytes(I begin, I end) const |
| 2310 | { |
| 2311 | assert(end - begin == 20); |
| 2312 | assert(m_in); |
| 2313 | uint160 hash; |
| 2314 | std::copy(begin, end, hash.begin()); |
| 2315 | CKeyID keyid(hash); |
| 2316 | CPubKey pubkey; |
| 2317 | if (m_in->GetPubKey(keyid, pubkey)) { |
| 2318 | if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) { |
| 2319 | Key key = m_keys.size(); |
| 2320 | m_keys.emplace_back(); |
| 2321 | m_keys.back().push_back(std::move(pubkey_provider)); |
| 2322 | return key; |
| 2323 | } |
| 2324 | } |
| 2325 | return {}; |
| 2326 | } |
| 2327 | |
| 2328 | miniscript::MiniscriptContext MsContext() const { |
| 2329 | return m_script_ctx; |
nothing calls this directly
no test coverage detected