diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/compressor.cpp | 1 | ||||
-rw-r--r-- | src/script/compressor.h | 2 | ||||
-rw-r--r-- | src/script/script.h | 6 | ||||
-rw-r--r-- | src/script/standard.cpp | 2 | ||||
-rw-r--r-- | src/script/standard.h | 9 |
5 files changed, 14 insertions, 6 deletions
diff --git a/src/script/compressor.cpp b/src/script/compressor.cpp index 51a3cf6025..dbb4df8b7c 100644 --- a/src/script/compressor.cpp +++ b/src/script/compressor.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "compressor.h" +#include "script/standard.h" bool CScriptCompressor::IsToKeyID(CKeyID &hash) const { diff --git a/src/script/compressor.h b/src/script/compressor.h index 53c6bf3ecc..f48ecf5001 100644 --- a/src/script/compressor.h +++ b/src/script/compressor.h @@ -8,6 +8,8 @@ #include "script/script.h" +class CScriptID; + /** Compact serializer for scripts. * * It detects common cases and encodes them much more efficiently. diff --git a/src/script/script.h b/src/script/script.h index caf176476f..4d685f5596 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -610,12 +610,6 @@ public: } return str; } - - CScriptID GetID() const - { - return CScriptID(Hash160(*this)); - } - void clear() { // The default std::vector::clear() does not release memory. diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 53ae254d59..adbec01f2e 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -14,6 +14,8 @@ using namespace std; typedef vector<unsigned char> valtype; +CScriptID::CScriptID(const CScript& in) : uint160(in.size() ? Hash160(in.begin(), in.end()) : 0) {} + const char* GetTxnOutputType(txnouttype t) { switch (t) diff --git a/src/script/standard.h b/src/script/standard.h index ead79b82a2..38d0b59885 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -13,6 +13,15 @@ class CScript; +/** A reference to a CScript: the Hash160 of its serialization (see script.h) */ +class CScriptID : public uint160 +{ +public: + CScriptID() : uint160(0) {} + CScriptID(const CScript& in); + CScriptID(const uint160& in) : uint160(in) {} +}; + static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes // Mandatory script verification flags that all new blocks must comply with for |