diff options
| author | Pieter Wuille <[email protected]> | 2016-10-28 16:29:17 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-11-07 13:56:27 -0800 |
| commit | 528472111b4965b1a99c4bcf08ac5ec93d87f10f (patch) | |
| tree | 2daf6bc17f8c26083d6597ad8632aa7cf2eef7ef /src/script/bitcoinconsensus.cpp | |
| parent | Make GetSerializeSize a wrapper on top of CSizeComputer (diff) | |
| download | discoin-528472111b4965b1a99c4bcf08ac5ec93d87f10f.tar.xz discoin-528472111b4965b1a99c4bcf08ac5ec93d87f10f.zip | |
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/script/bitcoinconsensus.cpp')
| -rw-r--r-- | src/script/bitcoinconsensus.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp index ec573c318..069ac55bf 100644 --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/bitcoinconsensus.cpp @@ -42,10 +42,12 @@ public: template<typename T> TxInputStream& operator>>(T& obj) { - ::Unserialize(*this, obj, m_type, m_version); + ::Unserialize(*this, obj); return *this; } + int GetVersion() const { return m_version; } + int GetType() const { return m_type; } private: const int m_type; const int m_version; |