diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-03-12 00:32:37 -0700 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-03-12 00:32:46 -0700 |
commit | 092a57df996be75e3a45e9dc69d15138093f503b (patch) | |
tree | be5f80d07b7e897772b71ac0037e7b81232b775b /contrib | |
parent | Merge pull request #6248 (diff) | |
parent | p2p: remove obsolete local time in handshake (diff) | |
download | monero-092a57df996be75e3a45e9dc69d15138093f503b.tar.xz |
Merge pull request #6243
4771a7ae p2p: remove obsolete local time in handshake (moneromooo-monero)
2fbbc4a2 p2p: avoid sending the same peer list over and over (moneromooo-monero)
3004835b epee: remove backward compatible endian specific address serialization (moneromooo-monero)
39a343d7 p2p: remove backward compatible peer list (moneromooo-monero)
60631802 p2p: simplify last_seen serialization now we have optional stores (moneromooo-monero)
9467b2e4 cryptonote_protocol: omit top 64 bits of difficulty when 0 (moneromooo-monero)
b595583f serialization: do not write optional fields with default value (moneromooo-monero)
5f98b46d p2p: remove obsolete local time from TIMED_SYNC (moneromooo-monero)
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/epee/include/net/net_utils_base.h | 8 | ||||
-rw-r--r-- | contrib/epee/include/serialization/keyvalue_serialization.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/contrib/epee/include/net/net_utils_base.h b/contrib/epee/include/net/net_utils_base.h index 028e605d7..d86c62c17 100644 --- a/contrib/epee/include/net/net_utils_base.h +++ b/contrib/epee/include/net/net_utils_base.h @@ -94,17 +94,13 @@ namespace net_utils BEGIN_KV_SERIALIZE_MAP() if (is_store) { - KV_SERIALIZE_VAL_POD_AS_BLOB_N(m_ip, "ip") uint32_t ip = SWAP32LE(this_ref.m_ip); epee::serialization::selector<is_store>::serialize(ip, stg, hparent_section, "m_ip"); } else { - if (!epee::serialization::selector<is_store>::serialize_t_val_as_blob(this_ref.m_ip, stg, hparent_section, "ip")) - { - KV_SERIALIZE(m_ip) - const_cast<ipv4_network_address&>(this_ref).m_ip = SWAP32LE(this_ref.m_ip); - } + KV_SERIALIZE(m_ip) + const_cast<ipv4_network_address&>(this_ref).m_ip = SWAP32LE(this_ref.m_ip); } KV_SERIALIZE(m_port) END_KV_SERIALIZE_MAP() diff --git a/contrib/epee/include/serialization/keyvalue_serialization.h b/contrib/epee/include/serialization/keyvalue_serialization.h index 78d294d05..fd343865c 100644 --- a/contrib/epee/include/serialization/keyvalue_serialization.h +++ b/contrib/epee/include/serialization/keyvalue_serialization.h @@ -89,6 +89,8 @@ public: \ #define KV_SERIALIZE_OPT_N(variable, val_name, default_value) \ do { \ + if (is_store && this_ref.variable == default_value) \ + break; \ if (!epee::serialization::selector<is_store>::serialize(this_ref.variable, stg, hparent_section, val_name)) \ epee::serialize_default(this_ref.variable, default_value); \ } while (0); |