mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 10:37:58 +00:00
Increase metric only if actually publishing (#8618)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user