6 #ifndef BITCOIN_COMPRESSOR_H
7 #define BITCOIN_COMPRESSOR_H
52 template<
typename Stream>
54 std::vector<unsigned char> compr;
64 template<
typename Stream>
66 unsigned int nSize = 0;
68 if (nSize < nSpecialScripts) {
88 template<
typename Stream,
typename I>
void Ser(Stream& s, I val)
92 template<
typename Stream,
typename I>
void Unser(Stream& s, I& val)
106 #endif // BITCOIN_COMPRESSOR_H
bool CompressScript(const CScript &script, std::vector< unsigned char > &out)
uint64_t DecompressAmount(uint64_t nAmount)
void Ser(Stream &s, const CScript &script)
wrapper for CTxOut that provides a more compact serialization
bool DecompressScript(CScript &script, unsigned int nSize, const std::vector< unsigned char > &out)
void Ser(Stream &s, I val)
void Unser(Stream &s, CScript &script)
Compact serializer for scripts.
static const unsigned int nSpecialScripts
make this static for now (there are only 6 special scripts defined) this can potentially be extended ...
An output of a transaction.
static const int MAX_SCRIPT_SIZE
unsigned int GetSpecialScriptSize(unsigned int nSize)
void Unser(Stream &s, I &val)
Serialized script, used inside transaction inputs and outputs.
FORMATTER_METHODS(CTxOut, obj)
uint64_t CompressAmount(uint64_t nAmount)
Compress amount.
Span< A > constexpr MakeSpan(A(&a)[N])
MakeSpan for arrays: