6 #ifndef BITCOIN_COMPRESSOR_H 7 #define BITCOIN_COMPRESSOR_H 51 template<
typename Stream>
53 std::vector<unsigned char> compr;
63 template<
typename Stream>
65 unsigned int nSize = 0;
74 if (nSize > MAX_SCRIPT_SIZE) {
96 template <
typename Stream,
typename Operation>
98 if (!ser_action.ForRead()) {
111 #endif // BITCOIN_COMPRESSOR_H
void resize(size_type new_size)
bool CompressScript(const CScript &script, std::vector< unsigned char > &out)
uint64_t DecompressAmount(uint64_t nAmount)
wrapper for CTxOut that provides a more compact serialization
bool DecompressScript(CScript &script, unsigned int nSize, const std::vector< unsigned char > &out)
Compact serializer for scripts.
CTxOutCompressor(CTxOut &txoutIn)
constexpr Span< A > MakeSpan(A(&a)[N])
Create a span to a container exposing data() and size().
CScriptCompressor(CScript &scriptIn)
An encapsulated public key.
An output of a transaction.
unsigned int GetSpecialScriptSize(unsigned int nSize)
static const unsigned int nSpecialScripts
make this static for now (there are only 6 special scripts defined) this can potentially be extended ...
Serialized script, used inside transaction inputs and outputs.
A reference to a CKey: the Hash360 of its serialized public key.
A reference to a CScript: the Hash360 of its serialization (see script.h)
void SerializationOp(Stream &s, Operation ser_action)
T & REF(const T &val)
Used to bypass the rule against non-const reference to temporary where it makes sense with wrappers...
void Unserialize(Stream &s)
uint64_t CompressAmount(uint64_t nAmount)
void Serialize(Stream &s) const