From 5b44a75493a1a098404d5e21dc384e74eae1892e Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 22 Oct 2019 00:07:31 +0200 Subject: refactor: Remove unused CExt{Pub,}Key (de)serialization methods The serialization/deserialization methods for the classes CExtKey and CExtPubKey were only used in the BIP32 unit tests, where the relevant parts are removed as well. --- src/pubkey.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/pubkey.h') diff --git a/src/pubkey.h b/src/pubkey.h index 089324ffda..fd815a871b 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -222,31 +222,6 @@ struct CExtPubKey { void Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const; void Decode(const unsigned char code[BIP32_EXTKEY_SIZE]); bool Derive(CExtPubKey& out, unsigned int nChild) const; - - void Serialize(CSizeComputer& s) const - { - // Optimized implementation for ::GetSerializeSize that avoids copying. - s.seek(BIP32_EXTKEY_SIZE + 1); // add one byte for the size (compact int) - } - template - void Serialize(Stream& s) const - { - unsigned int len = BIP32_EXTKEY_SIZE; - ::WriteCompactSize(s, len); - unsigned char code[BIP32_EXTKEY_SIZE]; - Encode(code); - s.write((const char *)&code[0], len); - } - template - void Unserialize(Stream& s) - { - unsigned int len = ::ReadCompactSize(s); - unsigned char code[BIP32_EXTKEY_SIZE]; - if (len != BIP32_EXTKEY_SIZE) - throw std::runtime_error("Invalid extended key size\n"); - s.read((char *)&code[0], len); - Decode(code); - } }; /** Users of this module must hold an ECCVerifyHandle. The constructor and -- cgit v1.2.3