diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-14 17:25:00 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:28:31 +0100 |
commit | cc7f449d57a490d0f3f24cf9584ff280063939a2 (patch) | |
tree | e1ba2c90293abafce5f52463ec93fa3453d4a5cd /src/cryptonote_core | |
parent | crypto: error out where appropriate (diff) | |
download | monero-cc7f449d57a490d0f3f24cf9584ff280063939a2.tar.xz |
make rct tx serialization work
It may be suboptimal, but it's a pain to have to rebuild everything
when some of this changes.
Also, no clue why there seems to be two different code paths for
serializing a tx...
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_boost_serialization.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_boost_serialization.h b/src/cryptonote_core/cryptonote_boost_serialization.h index 79ceec5bc..6a6ff5a7d 100644 --- a/src/cryptonote_core/cryptonote_boost_serialization.h +++ b/src/cryptonote_core/cryptonote_boost_serialization.h @@ -40,6 +40,7 @@ #include "cryptonote_basic.h" #include "common/unordered_containers_boost_serialization.h" #include "crypto/crypto.h" +#include "ringct/rctTypes.h" //namespace cryptonote { namespace boost @@ -163,6 +164,61 @@ namespace boost a & b.miner_tx; a & b.tx_hashes; } + + template <class Archive> + inline void serialize(Archive &a, rct::key &x, const boost::serialization::version_type ver) + { + a & reinterpret_cast<char (&)[sizeof(rct::key)]>(x); + } + + template <class Archive> + inline void serialize(Archive &a, rct::ctkey &x, const boost::serialization::version_type ver) + { + a & x.dest; + a & x.mask; + } + + template <class Archive> + inline void serialize(Archive &a, rct::rangeSig &x, const boost::serialization::version_type ver) + { + a & x.asig; + a & x.Ci; + } + + template <class Archive> + inline void serialize(Archive &a, rct::asnlSig &x, const boost::serialization::version_type ver) + { + a & x.L1; + a & x.s2; + a & x.s; + } + + template <class Archive> + inline void serialize(Archive &a, rct::mgSig &x, const boost::serialization::version_type ver) + { + a & x.ss; + a & x.cc; + a & x.II; + } + + template <class Archive> + inline void serialize(Archive &a, rct::ecdhTuple &x, const boost::serialization::version_type ver) + { + a & x.mask; + a & x.amount; + a & x.senderPk; + } + + template <class Archive> + inline void serialize(Archive &a, rct::rctSig &x, const boost::serialization::version_type ver) + { + a & x.rangeSigs; + a & x.MG; + a & x.mixRing; + a & x.ecdhInfo; + a & x.outPk; + a & x.txnFee; + } } } |