MCPcopy Create free account
hub / github.com/ElementsProject/elements / ToNormalizedString

Method ToNormalizedString

src/script/descriptor.cpp:219–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 return true;
218 }
219 bool ToNormalizedString(const SigningProvider& arg, std::string& ret, const DescriptorCache* cache) const override
220 {
221 std::string sub;
222 if (!m_provider->ToNormalizedString(arg, sub, cache)) return false;
223 // If m_provider is a BIP32PubkeyProvider, we may get a string formatted like a OriginPubkeyProvider
224 // In that case, we need to strip out the leading square bracket and fingerprint from the substring,
225 // and append that to our own origin string.
226 if (sub[0] == '[') {
227 sub = sub.substr(9);
228 ret = "[" + OriginString() + std::move(sub);
229 } else {
230 ret = "[" + OriginString() + "]" + std::move(sub);
231 }
232 return true;
233 }
234 bool GetPrivKey(int pos, const SigningProvider& arg, CKey& key) const override
235 {
236 return m_provider->GetPrivKey(pos, arg, key);

Callers

nothing calls this directly

Calls 1

ToNormalizedStringMethod · 0.45

Tested by

no test coverage detected