don't emit key expiration metric instead of setting it to zero

This commit is contained in:
trinity-1686a 2023-03-19 10:31:28 +01:00
parent 0222fc4d71
commit 0c634999c1
No known key found for this signature in database
GPG Key ID: 7F9D324B2661C978

View File

@ -1009,18 +1009,15 @@ fill_signing_cert_expiry(void)
const tor_cert_t *signing_key;
const relay_metrics_entry_t *rentry =
&base_metrics[RELAY_METRICS_SIGNING_CERT_EXPIRY];
uint64_t valid_until = 0;
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
rentry->help);
if (get_options()->OfflineMasterKey) {
signing_key = get_master_signing_key_cert();
if (signing_key) {
valid_until = signing_key->valid_until;
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
rentry->help);
metrics_store_entry_update(sentry, signing_key->valid_until);
}
}
metrics_store_entry_update(sentry, valid_until);
}
/** Reset the global store and fill it with all the metrics from base_metrics