From a7d82cf197ed20057ead7498bb0c645426077261 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 11 Jul 2016 18:44:52 -0400 Subject: [PATCH] delete GXS IDs with no TS --- libretroshare/src/services/p3idservice.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index f521f38be..29b5e0794 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -340,17 +340,15 @@ public: std::map::const_iterator it = mLastUsageTS.find(gxs_id) ; - if(it == mLastUsageTS.end()) - { - std::cerr << "No Ts for this ID => kept" << std::endl; - return true ; - } + bool no_ts = (it == mLastUsageTS.end()) ; - time_t last_usage_ts = it->second; + time_t last_usage_ts = no_ts?0:(it->second); time_t max_keep_time ; - if(is_id_banned) - max_keep_time = MAX_KEEP_KEYS_BANNED ; + if(no_ts) + max_keep_time = 0 ; + else if(is_id_banned) + max_keep_time = MAX_KEEP_KEYS_BANNED ; else if(is_known_id) max_keep_time = MAX_KEEP_KEYS_SIGNED_KNOWN ; else if(is_signed_id)