diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-10-28 16:29:17 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-07 13:56:27 -0800 |
commit | 528472111b4965b1a99c4bcf08ac5ec93d87f10f (patch) | |
tree | 2daf6bc17f8c26083d6597ad8632aa7cf2eef7ef /src/pubkey.h | |
parent | 657e05ab2e87ff725723fe8a375fc3f8aad02126 (diff) |
Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods
and functions. There is only one place where it's read and has an impact
(in CAddress), and even there it does not impact any of the recursively
invoked serializers.
Instead, the few places that need nType or nVersion are changed to read
it directly from the stream object, through GetType() and GetVersion()
methods which are added to all stream classes.
Diffstat (limited to 'src/pubkey.h')
-rw-r--r-- | src/pubkey.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pubkey.h b/src/pubkey.h index 3277218bb6..15207f89e1 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -117,14 +117,14 @@ public: //! Implement serialization, as if this was a byte vector. template <typename Stream> - void Serialize(Stream& s, int nType, int nVersion) const + void Serialize(Stream& s) const { unsigned int len = size(); ::WriteCompactSize(s, len); s.write((char*)vch, len); } template <typename Stream> - void Unserialize(Stream& s, int nType, int nVersion) + void Unserialize(Stream& s) { unsigned int len = ::ReadCompactSize(s); if (len <= 65) { @@ -211,7 +211,7 @@ struct CExtPubKey { bool Derive(CExtPubKey& out, unsigned int nChild) const; template <typename Stream> - void Serialize(Stream& s, int nType, int nVersion) const + void Serialize(Stream& s) const { unsigned int len = BIP32_EXTKEY_SIZE; ::WriteCompactSize(s, len); @@ -220,7 +220,7 @@ struct CExtPubKey { s.write((const char *)&code[0], len); } template <typename Stream> - void Unserialize(Stream& s, int nType, int nVersion) + void Unserialize(Stream& s) { unsigned int len = ::ReadCompactSize(s); unsigned char code[BIP32_EXTKEY_SIZE]; |