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

Class TxInUndoSerializer

src/undo.h:21–37  ·  view source on GitHub ↗

Undo information for a CTxIn * * Contains the prevout's CTxOut being spent, and its metadata as well * (coinbase or not, height). The serialization contains a dummy value of * zero. This is compatible with older versions which expect to see * the transaction version there. */

Source from the content-addressed store, hash-verified

19 * the transaction version there.
20 */
21class TxInUndoSerializer
22{
23 const Coin* txout;
24
25public:
26 template<typename Stream>
27 void Serialize(Stream &s) const {
28 ::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1u : 0u)));
29 if (txout->nHeight > 0) {
30 // Required to maintain compatibility with older undo format.
31 ::Serialize(s, (unsigned char)0);
32 }
33 ::Serialize(s, CTxOutCompressor(REF(txout->out)));
34 }
35
36 explicit TxInUndoSerializer(const Coin* coin) : txout(coin) {}
37};
38
39class TxInUndoDeserializer
40{

Callers 1

SerializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected