diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-27 20:24:39 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-27 20:24:39 +0000 |
commit | f113b92b9320d2300f9d493b63fb6edfd292acdc (patch) | |
tree | f8e6693acc0ab56630e65e78a1bba5d12e89eda5 /src/cryptonote_basic/cryptonote_basic.h | |
parent | node_rpc_proxy: allow caching daemon RPC version (diff) | |
download | monero-f113b92b9320d2300f9d493b63fb6edfd292acdc.tar.xz |
core: add functions to serialize base tx info
That is, information without signatures (for v1) nor range
proofs and MGs (for v2)
Diffstat (limited to 'src/cryptonote_basic/cryptonote_basic.h')
-rw-r--r-- | src/cryptonote_basic/cryptonote_basic.h | 22 |
1 files changed, 22 insertions, 0 deletions
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<bool W, template <bool> class Archive> + bool serialize_base(Archive<W> &ar) + { + FIELDS(*static_cast<transaction_prefix *>(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); }; |