We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b806efa commit dbca0d2Copy full SHA for dbca0d2
1 file changed
src/config.rs
@@ -944,6 +944,18 @@ impl Context {
944
/// Determine whether the specified addr maps to the/a self addr.
945
/// Returns `false` if no addresses are configured.
946
pub(crate) async fn is_self_addr(&self, addr: &str) -> Result<bool> {
947
+ // Employ the config cache to optimize for `ConfiguredAddr` passed.
948
+ if !addr.is_empty()
949
+ && addr_cmp(
950
+ addr,
951
+ &self
952
+ .get_config(Config::ConfiguredAddr)
953
+ .await?
954
+ .unwrap_or_default(),
955
+ )
956
+ {
957
+ return Ok(true);
958
+ }
959
Ok(self
960
.get_all_self_addrs()
961
.await?
0 commit comments