28
28
29
29
#pragma once
30
30
31
- #include " common/unordered_containers_boost_serialization.h"
32
31
#include " cryptonote_config.h"
33
32
#include " cryptonote_basic/cryptonote_basic.h"
34
33
#include " curve_trees.h"
40
39
#include " serialization/serialization.h"
41
40
#include " tree_sync.h"
42
41
43
- #include < boost/serialization/deque.hpp>
44
- #include < boost/serialization/vector.hpp>
45
- #include < boost/serialization/version.hpp>
46
42
#include < deque>
47
43
#include < memory>
48
44
#include < unordered_map>
@@ -72,14 +68,6 @@ struct BlockMeta final
72
68
BlockHash blk_hash;
73
69
uint64_t n_leaf_tuples;
74
70
75
- template <class Archive >
76
- inline void serialize (Archive &a, const unsigned int ver)
77
- {
78
- a & blk_hash;
79
- a & blk_idx;
80
- a & n_leaf_tuples;
81
- }
82
-
83
71
BEGIN_SERIALIZE_OBJECT ()
84
72
FIELD (blk_idx)
85
73
FIELD (blk_hash)
@@ -96,13 +84,6 @@ struct CachedLeafChunk final
96
84
std::vector<OutputPair> leaves;
97
85
uint64_t ref_count;
98
86
99
- template <class Archive >
100
- inline void serialize (Archive &a, const unsigned int ver)
101
- {
102
- a & leaves;
103
- a & ref_count;
104
- }
105
-
106
87
BEGIN_SERIALIZE_OBJECT ()
107
88
FIELD (leaves)
108
89
FIELD (ref_count)
@@ -114,13 +95,6 @@ struct CachedTreeElemChunk final
114
95
std::vector<crypto::ec_point> tree_elems;
115
96
uint64_t ref_count;
116
97
117
- template <class Archive >
118
- inline void serialize (Archive &a, const unsigned int ver)
119
- {
120
- a & tree_elems;
121
- a & ref_count;
122
- }
123
-
124
98
BEGIN_SERIALIZE_OBJECT ()
125
99
FIELD (tree_elems)
126
100
FIELD (ref_count)
@@ -135,13 +109,6 @@ struct AssignedLeafIdx final
135
109
void assign_leaf (const LeafIdx idx) { leaf_idx = idx; assigned_leaf_idx = true ; }
136
110
void unassign_leaf () { leaf_idx = 0 ; assigned_leaf_idx = false ; }
137
111
138
- template <class Archive >
139
- inline void serialize (Archive &a, const unsigned int ver)
140
- {
141
- a & assigned_leaf_idx;
142
- a & leaf_idx;
143
- }
144
-
145
112
BEGIN_SERIALIZE_OBJECT ()
146
113
FIELD (assigned_leaf_idx)
147
114
FIELD (leaf_idx)
@@ -289,18 +256,6 @@ class TreeCache final : public TreeSync<C1, C2>
289
256
290
257
// Serialization
291
258
public:
292
- template <class Archive >
293
- inline void serialize (Archive &a, const unsigned int ver)
294
- {
295
- a & m_locked_outputs;
296
- a & m_locked_output_refs;
297
- a & m_output_count;
298
- a & m_registered_outputs;
299
- a & m_leaf_cache;
300
- a & m_tree_elem_cache;
301
- a & m_cached_blocks;
302
- }
303
-
304
259
BEGIN_SERIALIZE_OBJECT ()
305
260
VERSION_FIELD (TREE_CACHE_VERSION)
306
261
FIELD (m_locked_outputs)
@@ -320,24 +275,3 @@ using TreeCacheV1 = TreeCache<Selene, Helios>;
320
275
// ----------------------------------------------------------------------------------------------------------------------
321
276
}// namespace curve_trees
322
277
}// namespace fcmp_pp
323
-
324
- // Since BOOST_CLASS_VERSION does not work for templated class, implement it
325
- namespace boost
326
- {
327
- namespace serialization
328
- {
329
- template <typename C1, typename C2>
330
- struct version <fcmp_pp::curve_trees::TreeCache<C1, C2>>
331
- {
332
- typedef mpl::int_<fcmp_pp::curve_trees::TREE_CACHE_VERSION> type;
333
- typedef mpl::integral_c_tag tag;
334
- static constexpr int value = version::type::value;
335
- BOOST_MPL_ASSERT ((
336
- boost::mpl::less<
337
- boost::mpl::int_<fcmp_pp::curve_trees::TREE_CACHE_VERSION>,
338
- boost::mpl::int_<256 >
339
- >
340
- ));
341
- };
342
- }
343
- }
0 commit comments