diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-10-28 16:51:33 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-07 13:56:22 -0800 |
commit | 657e05ab2e87ff725723fe8a375fc3f8aad02126 (patch) | |
tree | e20cebbde1dee31d6d21dccdaa2223a5ca1566e3 /src/compressor.h | |
parent | fad9b66504f176ed3624515f3bf4d428cf687607 (diff) |
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.
Diffstat (limited to 'src/compressor.h')
-rw-r--r-- | src/compressor.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/compressor.h b/src/compressor.h index fa702f0dfa..90749499d1 100644 --- a/src/compressor.h +++ b/src/compressor.h @@ -55,14 +55,6 @@ protected: public: CScriptCompressor(CScript &scriptIn) : script(scriptIn) { } - unsigned int GetSerializeSize(int nType, int nVersion) const { - std::vector<unsigned char> compr; - if (Compress(compr)) - return compr.size(); - unsigned int nSize = script.size() + nSpecialScripts; - return script.size() + VARINT(nSize).GetSerializeSize(nType, nVersion); - } - template<typename Stream> void Serialize(Stream &s, int nType, int nVersion) const { std::vector<unsigned char> compr; |