aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorjeffro256 <jeffro256@tutanota.com>2023-11-27 19:28:08 -0600
committerjeffro256 <jeffro256@tutanota.com>2023-11-28 14:06:24 -0600
commit2525200185e6b470c6e6cec3c3c8044a0eb0ecc0 (patch)
treea2548c11d8729e6e128ff5d1f2b6057bce4f2c1b /src/rpc
parentserialization: fix infinite loops and clean up dispatching (diff)
downloadmonero-2525200185e6b470c6e6cec3c3c8044a0eb0ecc0.tar.xz
serialization: remove container wrappers and serialize directly
Some downstream code (most notably PR https://github.com/UkoeHB/monero/pull/25) wants to use the src/serialization lib for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use the `serializable_*` container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class field types. By serializing STL containers directly, we can abstract the serialization details away, making for much cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators, and Hashers are serializable. `std::multimap` is added to the list of serializable containers. Depends upon https://github.com/monero-project/monero/pull/9069.
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rpc_payment.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/rpc_payment.h b/src/rpc/rpc_payment.h
index 4ead5a344..a4cc6db57 100644
--- a/src/rpc/rpc_payment.h
+++ b/src/rpc/rpc_payment.h
@@ -148,8 +148,8 @@ namespace cryptonote
template <class t_archive>
inline void serialize(t_archive &a, const unsigned int ver)
{
- a & m_client_info.parent();
- a & m_hashrate.parent();
+ a & m_client_info;
+ a & m_hashrate;
a & m_credits_total;
a & m_credits_used;
a & m_nonces_good;
@@ -177,9 +177,9 @@ namespace cryptonote
cryptonote::account_public_address m_address;
uint64_t m_diff;
uint64_t m_credits_per_hash_found;
- serializable_unordered_map<crypto::public_key, client_info> m_client_info;
+ std::unordered_map<crypto::public_key, client_info> m_client_info;
std::string m_directory;
- serializable_map<uint64_t, uint64_t> m_hashrate;
+ std::map<uint64_t, uint64_t> m_hashrate;
uint64_t m_credits_total;
uint64_t m_credits_used;
uint64_t m_nonces_good;