aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h
index ea71baf902..1af781f45c 100644
--- a/src/main.h
+++ b/src/main.h
@@ -647,6 +647,20 @@ protected:
const CTxOut& GetOutputFor(const CTxIn& input, const MapPrevTx& inputs) const;
};
+/** wrapper for CTxOut that provides a more compact serialization */
+class CTxOutCompressor
+{
+private:
+ CTxOut &txout;
+public:
+ CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
+
+ IMPLEMENT_SERIALIZE(
+ READWRITE(VARINT(txout.nValue));
+ CScriptCompressor cscript(REF(txout.scriptPubKey));
+ READWRITE(cscript);
+ )
+};