From cae0c15d10235bf0ec0bd6f8b20814dc7b63dfd5 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Tue, 16 Jul 2024 08:16:57 +0200 Subject: p2p: check for the endpoints before listen/connect to them --- p2p/src/connection.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'p2p/src/connection.rs') diff --git a/p2p/src/connection.rs b/p2p/src/connection.rs index c1a7a8c..f2e9d1e 100644 --- a/p2p/src/connection.rs +++ b/p2p/src/connection.rs @@ -74,8 +74,7 @@ impl Connection { pub async fn recv(&self) -> Result { match self.listeners.get(&P::id()) { Some(l) => l.recv().await.map_err(Error::from), - // TODO - None => todo!(), + None => Err(Error::UnsupportedProtocol(P::id())), } } -- cgit v1.2.3