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

Method ToString

src/script/descriptor.cpp:507–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505 return final_extkey.pubkey;
506 }
507 std::string ToString(StringType type, bool normalized) const
508 {
509 // If StringType==COMPAT, always use the apostrophe to stay compatible with previous versions
510 const bool use_apostrophe = (!normalized && m_apostrophe) || type == StringType::COMPAT;
511 std::string ret = EncodeExtPubKey(m_root_extkey) + FormatHDKeypath(m_path, /*apostrophe=*/use_apostrophe);
512 if (IsRange()) {
513 ret += "/*";
514 if (m_derive == DeriveType::HARDENED_RANGED) ret += use_apostrophe ? '\'' : 'h';
515 }
516 return ret;
517 }
518 std::string ToString(StringType type=StringType::PUBLIC) const override
519 {
520 return ToString(type, /*normalized=*/false);

Callers

nothing calls this directly

Calls 3

EncodeExtPubKeyFunction · 0.85
FormatHDKeypathFunction · 0.85
ToStringFunction · 0.50

Tested by

no test coverage detected