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 d2e30e0 commit 299638dCopy full SHA for 299638d
src/discv5.rs
@@ -301,6 +301,13 @@ impl<P: ProtocolIdentity> Discv5<P> {
301
self.local_enr.read().clone()
302
}
303
304
+ /// Identical to `Discv5::local_enr` except that this exposes the `Arc` itself.
305
+ ///
306
+ /// This is useful for synchronising views of the local ENR outside of `Discv5`.
307
+ pub fn external_enr(&self) -> Arc<RwLock<Enr>> {
308
+ self.local_enr.clone()
309
+ }
310
+
311
/// Returns the routing table of the discv5 service
312
pub fn kbuckets(&self) -> KBucketsTable<NodeId, Enr> {
313
self.kbuckets.read().clone()
0 commit comments