Skip to content
Snippets Groups Projects
Commit c227ff78 authored by Pierre Krieger's avatar Pierre Krieger Committed by GitHub
Browse files

Increase metric only if actually publishing (#8618)

parent fa89371a
No related merge requests found
......@@ -290,6 +290,15 @@ where
Role::Discover => return Ok(()),
};
let keys = Worker::<Client, Network, Block, DhtEventStream>::get_own_public_keys_within_authority_set(
key_store.clone(),
self.client.as_ref(),
).await?.into_iter().map(Into::into).collect::<HashSet<_>>();
if only_if_changed && keys == self.latest_published_keys {
return Ok(())
}
let addresses = self.addresses_to_publish();
if let Some(metrics) = &self.metrics {
......@@ -304,15 +313,6 @@ where
.encode(&mut serialized_addresses)
.map_err(Error::EncodingProto)?;
let keys = Worker::<Client, Network, Block, DhtEventStream>::get_own_public_keys_within_authority_set(
key_store.clone(),
self.client.as_ref(),
).await?.into_iter().map(Into::into).collect::<HashSet<_>>();
if only_if_changed && keys == self.latest_published_keys {
return Ok(())
}
let keys_vec = keys.iter().cloned().collect::<Vec<_>>();
let signatures = key_store.sign_with_all(
key_types::AUTHORITY_DISCOVERY,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment