Make GetSerializeSize a wrapper on top of CSizeComputer
Given that in default GetSerializeSize implementations created by ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid of the specialized GetSerializeSize methods everywhere, and just use CSizeComputer. This removes a lot of code which isn't actually used anywhere. For CCompactSize and CVarInt this actually removes a more efficient size computing algorithm, which is brought back in a later commit.
This commit is contained in:
committed by
Jack Grigg
parent
7f4acac433
commit
b8a6579366
@@ -123,10 +123,6 @@ public:
|
||||
}
|
||||
|
||||
//! Implement serialization, as if this was a byte vector.
|
||||
unsigned int GetSerializeSize(int nType, int nVersion) const
|
||||
{
|
||||
return size() + 1;
|
||||
}
|
||||
template <typename Stream>
|
||||
void Serialize(Stream& s, int nType, int nVersion) const
|
||||
{
|
||||
@@ -218,10 +214,6 @@ struct CExtPubKey {
|
||||
void Decode(const unsigned char code[BIP32_EXTKEY_SIZE]);
|
||||
bool Derive(CExtPubKey& out, unsigned int nChild) const;
|
||||
|
||||
unsigned int GetSerializeSize(int nType, int nVersion) const
|
||||
{
|
||||
return BIP32_EXTKEY_SIZE+1; //add one byte for the size (compact int)
|
||||
}
|
||||
template <typename Stream>
|
||||
void Serialize(Stream& s, int nType, int nVersion) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user