From b595583f3dde9d7a6ef4c6a30d38d541eb6c6cd9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 4 Dec 2019 21:19:04 +0000 Subject: serialization: do not write optional fields with default value --- contrib/epee/include/serialization/keyvalue_serialization.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/epee') 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::serialize(this_ref.variable, stg, hparent_section, val_name)) \ epee::serialize_default(this_ref.variable, default_value); \ } while (0); -- cgit v1.2.3