6#ifndef BITCOIN_COMPRESSOR_H
7#define BITCOIN_COMPRESSOR_H
17 const std::vector<uint8_t> &out);
49 template <
typename Stream>
51 std::vector<uint8_t>
compr;
62 unsigned int nSize = 0;
83 template <
typename Stream,
typename I>
void Ser(
Stream &s,
I val) {
86 template <
typename Stream,
typename I>
void Unser(
Stream &s,
I &val) {
Serialized script, used inside transaction inputs and outputs.
An output of a transaction.
A Span is an object that can refer to a contiguous sequence of objects.
void resize(size_type new_size)
uint64_t CompressAmount(Amount nAmount)
Compress amount.
Amount DecompressAmount(uint64_t nAmount)
bool DecompressScript(CScript &script, unsigned int nSize, const std::vector< uint8_t > &out)
unsigned int GetSpecialScriptSize(unsigned int nSize)
bool CompressScript(const CScript &script, std::vector< uint8_t > &out)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static const int MAX_SCRIPT_SIZE
void Unser(Stream &s, I &val)
void Ser(Stream &s, I val)
Compact serializer for scripts.
void Unser(Stream &s, CScript &script)
static const unsigned int nSpecialScripts
make this static for now (there are only 6 special scripts defined) this can potentially be extended ...
void Ser(Stream &s, const CScript &script) const
wrapper for CTxOut that provides a more compact serialization
FORMATTER_METHODS(CTxOut, obj)