From 017cf68480e366c9827bb62e2cb2877845806396 Mon Sep 17 00:00:00 2001 From: parazyd Date: Mon, 21 Aug 2023 11:46:29 +0200 Subject: [PATCH] net/p2p: Expose the dnet subscriber through a function. --- src/net/p2p.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/p2p.rs b/src/net/p2p.rs index b18e4f31a..9d6f7d25c 100644 --- a/src/net/p2p.rs +++ b/src/net/p2p.rs @@ -320,9 +320,11 @@ impl P2p { } /// Return a reference to the dnet subscriber - pub async fn dnet_subscribe(&self) -> Subscription { - self.dnet_sub.clone().subscribe().await + pub fn dnet_sub(&self) -> SubscriberPtr { + self.dnet_sub.clone() } + + /// Send a dnet notification over the subscriber pub async fn dnet_notify(&self, event: DnetEvent) { self.dnet_sub.notify(event).await; }