| 398 | } |
| 399 | |
| 400 | void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) { |
| 401 | nDepth = code[0]; |
| 402 | memcpy(vchFingerprint, code+1, 4); |
| 403 | nChild = ReadBE32(code+5); |
| 404 | memcpy(chaincode.begin(), code+9, 32); |
| 405 | key.Set(code+42, code+BIP32_EXTKEY_SIZE, true); |
| 406 | if ((nDepth == 0 && (nChild != 0 || ReadLE32(vchFingerprint) != 0)) || code[41] != 0) key = CKey(); |
| 407 | } |
| 408 | |
| 409 | KeyPair::KeyPair(const CKey& key, const uint256* merkle_root) |
| 410 | { |