diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-07-07 00:54:42 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-07-07 10:45:31 -0700 |
commit | 0aadc11fd88b298c7af2dfb69763b2c67dc6b7b0 (patch) | |
tree | 02bb833749f472a916c9ff5f585af9e94b5326b8 /src/script/script.h | |
parent | 5af6572534986bf85f6806e2cc66c1f1f8e3c56c (diff) |
Avoid dereference-of-casted-pointer
Diffstat (limited to 'src/script/script.h')
-rw-r--r-- | src/script/script.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/script.h b/src/script/script.h index bbb37f049e..d16bfd0e00 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -8,6 +8,7 @@ #include "crypto/common.h" #include "prevector.h" +#include "serialize.h" #include <assert.h> #include <climits> @@ -404,6 +405,13 @@ public: CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { } CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { } + ADD_SERIALIZE_METHODS; + + template <typename Stream, typename Operation> + inline void SerializationOp(Stream& s, Operation ser_action) { + READWRITE(static_cast<CScriptBase&>(*this)); + } + CScript& operator+=(const CScript& b) { insert(end(), b.begin(), b.end()); |