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

Method Decode

src/pubkey.cpp:370–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370void CExtPubKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
371 nDepth = code[0];
372 memcpy(vchFingerprint, code+1, 4);
373 nChild = ReadBE32(code+5);
374 memcpy(chaincode.begin(), code+9, 32);
375 pubkey.Set(code+41, code+BIP32_EXTKEY_SIZE);
376 if ((nDepth == 0 && (nChild != 0 || ReadLE32(vchFingerprint) != 0)) || !pubkey.IsFullyValid()) pubkey = CPubKey();
377}
378
379void CExtPubKey::EncodeWithVersion(unsigned char code[BIP32_EXTKEY_WITH_VERSION_SIZE]) const
380{

Callers

nothing calls this directly

Calls 6

ReadLE32Function · 0.85
IsFullyValidMethod · 0.80
CPubKeyClass · 0.70
ReadBE32Function · 0.50
beginMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected