6 #ifndef BITCOIN_COMPRESSOR_H
7 #define BITCOIN_COMPRESSOR_H
52 bool Compress(std::vector<unsigned char> &out)
const;
54 bool Decompress(
unsigned int nSize,
const std::vector<unsigned char> &out);
58 template<
typename Stream>
60 std::vector<unsigned char> compr;
70 template<
typename Stream>
72 unsigned int nSize = 0;
81 if (nSize > MAX_SCRIPT_SIZE) {
106 template <
typename Stream,
typename Operation>
108 if (!ser_action.ForRead()) {
Wrapper for serializing arrays and POD.
A reference to a CKey: the Hash160 of its serialized public key.
An encapsulated public key.
Compact serializer for scripts.
bool IsToPubKey(CPubKey &pubkey) const
bool Decompress(unsigned int nSize, const std::vector< unsigned char > &out)
bool IsToKeyID(CKeyID &hash) const
These check for scripts for which a special case with a shorter encoding is defined.
static const unsigned int nSpecialScripts
make this static for now (there are only 6 special scripts defined) this can potentially be extended ...
void Serialize(Stream &s) const
bool Compress(std::vector< unsigned char > &out) const
void Unserialize(Stream &s)
bool IsToScriptID(CScriptID &hash) const
unsigned int GetSpecialSize(unsigned int nSize) const
CScriptCompressor(CScript &scriptIn)
Serialized script, used inside transaction inputs and outputs.
A reference to a CScript: the Hash160 of its serialization (see script.h)
wrapper for CTxOut that provides a more compact serialization
CTxOutCompressor(CTxOut &txoutIn)
void SerializationOp(Stream &s, Operation ser_action)
static uint64_t CompressAmount(uint64_t nAmount)
static uint64_t DecompressAmount(uint64_t nAmount)
An output of a transaction.
void resize(size_type new_size)
T & REF(const T &val)
Used to bypass the rule against non-const reference to temporary where it makes sense with wrappers s...