![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
Compact serializer for scripts. More...
#include <script.h>
Collaboration diagram for CScriptCompressor:Public Member Functions | |
| CScriptCompressor (CScript &scriptIn) | |
| unsigned int | GetSerializeSize (int nType, int nVersion) const |
| template<typename Stream > | |
| void | Serialize (Stream &s, int nType, int nVersion) const |
| template<typename Stream > | |
| void | Unserialize (Stream &s, int nType, int nVersion) |
Protected Member Functions | |
| bool | IsToKeyID (CKeyID &hash) const |
| bool | IsToScriptID (CScriptID &hash) const |
| bool | IsToPubKey (CPubKey &pubkey) const |
| bool | Compress (std::vector< unsigned char > &out) const |
| unsigned int | GetSpecialSize (unsigned int nSize) const |
| bool | Decompress (unsigned int nSize, const std::vector< unsigned char > &out) |
Private Attributes | |
| CScript & | script |
Static Private Attributes | |
| static const unsigned int | nSpecialScripts = 6 |
Compact serializer for scripts.
It detects common cases and encodes them much more efficiently. 3 special cases are defined:
Other scripts up to 121 bytes require 1 byte + script length. Above that, scripts up to 16505 bytes require 2 bytes + script length.
|
inline |
|
protected |
Definition at line 1976 of file script.cpp.
References memcpy().
Referenced by GetSerializeSize(), and Serialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 2016 of file script.cpp.
References CPubKey::begin(), CPubKey::Decompress(), memcpy(), OP_CHECKSIG, OP_DUP, OP_EQUAL, OP_EQUALVERIFY, OP_HASH160, and CPubKey::size().
Referenced by Unserialize().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 754 of file script.h.
References Compress(), nSpecialScripts, and VARINT.
Here is the call graph for this function:Definition at line 2007 of file script.cpp.
Referenced by Unserialize().
Here is the caller graph for this function:
|
protected |
Definition at line 1940 of file script.cpp.
References memcpy(), OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, and OP_HASH160.
Here is the call graph for this function:
|
protected |
Definition at line 1961 of file script.cpp.
References CPubKey::IsFullyValid(), OP_CHECKSIG, and CPubKey::Set().
Here is the call graph for this function:
|
protected |
Definition at line 1951 of file script.cpp.
References memcpy(), OP_EQUAL, and OP_HASH160.
Here is the call graph for this function:
|
inline |
Definition at line 763 of file script.h.
References Compress(), nSpecialScripts, and VARINT.
Here is the call graph for this function:
|
inline |
Definition at line 775 of file script.h.
References Decompress(), GetSpecialSize(), nSpecialScripts, REF(), and VARINT.
Here is the call graph for this function:
|
staticprivate |
Definition at line 735 of file script.h.
Referenced by GetSerializeSize(), Serialize(), and Unserialize().
1.8.8