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

Method ToPrivateString

src/script/descriptor.cpp:522–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520 return ToString(type, /*normalized=*/false);
521 }
522 bool ToPrivateString(const SigningProvider& arg, std::string& out) const override
523 {
524 CExtKey key;
525 if (!GetExtKey(arg, key)) {
526 out = ToString(StringType::PUBLIC);
527 return false;
528 }
529 out = EncodeExtKey(key) + FormatHDKeypath(m_path, /*apostrophe=*/m_apostrophe);
530 if (IsRange()) {
531 out += "/*";
532 if (m_derive == DeriveType::HARDENED_RANGED) out += m_apostrophe ? '\'' : 'h';
533 }
534 return true;
535 }
536 bool ToNormalizedString(const SigningProvider& arg, std::string& out, const DescriptorCache* cache) const override
537 {
538 if (m_derive == DeriveType::HARDENED_RANGED) {

Callers

nothing calls this directly

Calls 3

EncodeExtKeyFunction · 0.85
FormatHDKeypathFunction · 0.85
ToStringFunction · 0.50

Tested by

no test coverage detected