MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / CTxOutCompressor

Class CTxOutCompressor

src/compressor.h:86–109  ·  view source on GitHub ↗

wrapper for CTxOut that provides a more compact serialization */

Source from the content-addressed store, hash-verified

84
85/** wrapper for CTxOut that provides a more compact serialization */
86class CTxOutCompressor
87{
88private:
89 CTxOut &txout;
90
91public:
92 explicit CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
93
94 ADD_SERIALIZE_METHODS;
95
96 template <typename Stream, typename Operation>
97 inline void SerializationOp(Stream& s, Operation ser_action) {
98 if (!ser_action.ForRead()) {
99 uint64_t nVal = CompressAmount(txout.nValue);
100 READWRITE(VARINT(nVal));
101 } else {
102 uint64_t nVal = 0;
103 READWRITE(VARINT(nVal));
104 txout.nValue = DecompressAmount(nVal);
105 }
106 CScriptCompressor cscript(REF(txout.scriptPubKey));
107 READWRITE(cscript);
108 }
109};
110
111#endif // BITCOIN_COMPRESSOR_H

Callers 5

SerializeMethod · 0.85
UnserializeMethod · 0.85
UnserializeMethod · 0.85
SerializeMethod · 0.85
UnserializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected