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

Function DecodeExtPubKey

src/key_io.cpp:245–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245CExtPubKey DecodeExtPubKey(const std::string& str)
246{
247 CExtPubKey key;
248 std::vector<unsigned char> data;
249 if (DecodeBase58Check(str, data, 78)) {
250 const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
251 if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
252 key.Decode(data.data() + prefix.size());
253 }
254 }
255 return key;
256}
257
258std::string EncodeExtPubKey(const CExtPubKey& key)
259{

Callers 6

createwalletdescriptorFunction · 0.85
addhdkeyFunction · 0.85
ParsePubkeyInnerFunction · 0.85
RunTestFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
key_io.cppFile · 0.85

Calls 7

DecodeBase58CheckFunction · 0.85
ParamsClass · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
DecodeMethod · 0.45
dataMethod · 0.45

Tested by 2

RunTestFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68