aboutsummaryrefslogtreecommitdiff
path: root/src/script/script.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-07-15 12:06:13 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-07-15 12:22:50 -0700
commit10b22e3141a603ec891d2cfc7100c29c7409aabe (patch)
tree6659c1b76b6371b6ec453f77dfee463b28407384 /src/script/script.h
parentafd2fca911c4a5e3a4d1f0993a226d40f250aff4 (diff)
parent0aadc11fd88b298c7af2dfb69763b2c67dc6b7b0 (diff)
downloadbitcoin-10b22e3141a603ec891d2cfc7100c29c7409aabe.tar.xz
Merge #10760: Avoid dereference-of-casted-pointer
0aadc11fd Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: And prefer a static_cast to the intended reference type. Tree-SHA512: e83b20023a4dca6029b46f7040a8a6fd54e1b42112ec0c87c3c3b567ed641de97a9e2335b57a2efb075491f641e5b977bc226a474276bea0c3c3c71d8d6ac54d
Diffstat (limited to 'src/script/script.h')
-rw-r--r--src/script/script.h8
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());