From f113b92b9320d2300f9d493b63fb6edfd292acdc Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 27 Feb 2017 20:24:39 +0000 Subject: core: add functions to serialize base tx info That is, information without signatures (for v1) nor range proofs and MGs (for v2) --- src/cryptonote_basic/cryptonote_basic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/cryptonote_basic/cryptonote_basic.h') diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index f933e9cac..ed2787cf7 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -250,6 +250,28 @@ namespace cryptonote } END_SERIALIZE() + template class Archive> + bool serialize_base(Archive &ar) + { + FIELDS(*static_cast(this)) + + if (version == 1) + { + } + else + { + ar.tag("rct_signatures"); + if (!vin.empty()) + { + ar.begin_object(); + bool r = rct_signatures.serialize_rctsig_base(ar, vin.size(), vout.size()); + if (!r || !ar.stream().good()) return false; + ar.end_object(); + } + } + return true; + } + private: static size_t get_signature_size(const txin_v& tx_in); }; -- cgit v1.2.3