diff --git a/src/discv5.rs b/src/discv5.rs index 626e9117..5b7d4553 100644 --- a/src/discv5.rs +++ b/src/discv5.rs @@ -267,6 +267,10 @@ impl Discv5

{ nodes_to_send } + pub fn ip_mode(&self) -> IpMode { + self.ip_mode + } + /// Mark a node in the routing table as `Disconnected`. /// /// A `Disconnected` node will be present in the routing table and will be only @@ -568,10 +572,10 @@ impl Discv5

{ } } - /// Request a TALK message from a node, identified via the ENR. + /// Request a TALK message from a node, identified via the NodeContact. pub fn talk_req( &self, - enr: Enr, + node_contact: NodeContact, protocol: Vec, request: Vec, ) -> impl Future, RequestError>> + 'static { @@ -579,10 +583,8 @@ impl Discv5

{ let (callback_send, callback_recv) = oneshot::channel(); let channel = self.clone_channel(); - let ip_mode = self.ip_mode; async move { - let node_contact = NodeContact::try_from_enr(enr, ip_mode)?; let channel = channel.map_err(|_| RequestError::ServiceNotStarted)?; let event = ServiceRequest::Talk(node_contact, protocol, request, callback_send);