Bitcoin Core  21.99.0
P2P Digital Currency
Public Member Functions | Static Public Attributes | List of all members
ScriptCompression Struct Reference

Compact serializer for scripts. More...

#include <compressor.h>

Public Member Functions

template<typename Stream >
void Ser (Stream &s, const CScript &script)
 
template<typename Stream >
void Unser (Stream &s, CScript &script)
 

Static Public Attributes

static const unsigned int nSpecialScripts = 6
 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. More...
 

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.

Definition at line 42 of file compressor.h.

Member Function Documentation

◆ Ser()

template<typename Stream >
void ScriptCompression::Ser ( Stream &  s,
const CScript script 
)
inline

Definition at line 53 of file compressor.h.

Here is the call graph for this function:

◆ Unser()

template<typename Stream >
void ScriptCompression::Unser ( Stream &  s,
CScript script 
)
inline

Definition at line 65 of file compressor.h.

Here is the call graph for this function:

Member Data Documentation

◆ nSpecialScripts

const unsigned int ScriptCompression::nSpecialScripts = 6
static

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.

Definition at line 50 of file compressor.h.


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