Bitcoin
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
CScriptCompressor Class Reference

#include <compressor.h>

Public Member Functions

 CScriptCompressor (CScript &scriptIn)
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
void Unserialize (Stream &s)
 

Private Attributes

CScriptscript
 

Static Private Attributes

static const unsigned int nSpecialScripts = 6
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CScriptCompressor()

CScriptCompressor::CScriptCompressor ( CScript scriptIn)
inlineexplicit

Member Function Documentation

◆ Serialize()

template<typename Stream >
void CScriptCompressor::Serialize ( Stream &  s) const
inline

◆ Unserialize()

template<typename Stream >
void CScriptCompressor::Unserialize ( Stream &  s)
inline

Member Data Documentation

◆ nSpecialScripts

const unsigned int CScriptCompressor::nSpecialScripts = 6
staticprivate

make this static for now (there are only 6 special scripts defined) this can potentially be extended together with a new nVersion for transactions, in which case this value becomes dependent on nVersion and nHeight of the enclosing transaction.

◆ script

CScript& CScriptCompressor::script
private

The documentation for this class was generated from the following file: