aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-08 16:41:44 -0800
committerRiccardo Spagni <ric@spagni.net>2017-01-08 16:41:44 -0800
commitba9744d4000268dedb08a00125776ccf526064f7 (patch)
treee1bc533f628fcc85356eba84653e10517eb04352 /src/cryptonote_core
parentMerge pull request #1514 (diff)
parentportable serializer: tests added (diff)
downloadmonero-ba9744d4000268dedb08a00125776ccf526064f7.tar.xz
Merge pull request #1515
ada7c7da portable serializer: tests added (kenshi84) f390a0e2 portable serializer: make signerd/unsigned tx portable, ignore archive version checking (kenshi84)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/cryptonote_format_utils.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/cryptonote_core/cryptonote_format_utils.h b/src/cryptonote_core/cryptonote_format_utils.h
index 704b8467d..a6610e60d 100644
--- a/src/cryptonote_core/cryptonote_format_utils.h
+++ b/src/cryptonote_core/cryptonote_format_utils.h
@@ -36,7 +36,8 @@
#include "crypto/crypto.h"
#include "crypto/hash.h"
#include "ringct/rctOps.h"
-
+#include <boost/serialization/vector.hpp>
+#include <boost/serialization/utility.hpp>
namespace cryptonote
{
@@ -62,16 +63,6 @@ namespace cryptonote
rct::key mask; //ringct amount mask
void push_output(uint64_t idx, const crypto::public_key &k, uint64_t amount) { outputs.push_back(std::make_pair(idx, rct::ctkey({rct::pk2rct(k), rct::zeroCommit(amount)}))); }
-
- BEGIN_SERIALIZE_OBJECT()
- FIELD(outputs)
- VARINT_FIELD(real_output)
- FIELD(real_out_tx_key)
- VARINT_FIELD(real_output_in_tx_index)
- VARINT_FIELD(amount)
- FIELD(rct)
- FIELD(mask)
- END_SERIALIZE()
};
struct tx_destination_entry
@@ -261,3 +252,23 @@ namespace cryptonote
specific_type& variable_name = boost::get<specific_type>(variant_var);
}
+
+BOOST_CLASS_VERSION(cryptonote::tx_source_entry, 0)
+
+namespace boost
+{
+ namespace serialization
+ {
+ template <class Archive>
+ inline void serialize(Archive &a, cryptonote::tx_source_entry &x, const boost::serialization::version_type ver)
+ {
+ a & x.outputs;
+ a & x.real_output;
+ a & x.real_out_tx_key;
+ a & x.real_output_in_tx_index;
+ a & x.amount;
+ a & x.rct;
+ a & x.mask;
+ }
+ }
+}