diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-04-15 07:56:22 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-04-15 07:59:38 +0200 |
| commit | 48c5adfbcea2006dc55011a3d7f27e30fbe4a6b3 (patch) | |
| tree | aa97931757b0d32416152502e9cf83060c7ece2c /src/key.cpp | |
| parent | Merge #7878: [test] bctest.py: Revert faa41ee (diff) | |
| parent | add bip32 pubkey serialization (diff) | |
| download | discoin-48c5adfbcea2006dc55011a3d7f27e30fbe4a6b3.tar.xz discoin-48c5adfbcea2006dc55011a3d7f27e30fbe4a6b3.zip | |
Merge #6215: add bip32 pub key serialization
90604f1 add bip32 pubkey serialization (Jonas Schnelli)
Diffstat (limited to 'src/key.cpp')
| -rw-r--r-- | src/key.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/key.cpp b/src/key.cpp index 28ba5144e..6a3d9aa14 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -275,7 +275,7 @@ CExtPubKey CExtKey::Neuter() const { return ret; } -void CExtKey::Encode(unsigned char code[74]) const { +void CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const { code[0] = nDepth; memcpy(code+1, vchFingerprint, 4); code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF; @@ -286,12 +286,12 @@ void CExtKey::Encode(unsigned char code[74]) const { memcpy(code+42, key.begin(), 32); } -void CExtKey::Decode(const unsigned char code[74]) { +void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) { nDepth = code[0]; memcpy(vchFingerprint, code+1, 4); nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8]; memcpy(chaincode.begin(), code+9, 32); - key.Set(code+42, code+74, true); + key.Set(code+42, code+BIP32_EXTKEY_SIZE, true); } bool ECC_InitSanityCheck() { |