MCPcopy Create free account
hub / github.com/ElementsProject/lightning / connect_peer

Method connect_peer

cln-grpc/src/server.rs:317–347  ·  view source on GitHub ↗
(
    &self,
    request: tonic::Request<pb::ConnectRequest>,
)

Source from the content-addressed store, hash-verified

315}
316
317async fn connect_peer(
318 &self,
319 request: tonic::Request<pb::ConnectRequest>,
320) -> Result<tonic::Response<pb::ConnectResponse>, tonic::Status> {
321 let req = request.into_inner();
322 let req: requests::ConnectRequest = req.into();
323 debug!("Client asked for connect_peer");
324 trace!("connect_peer request: {:?}", req);
325 let mut rpc = ClnRpc::new(&self.rpc_path)
326 .await
327 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
328 let result = rpc.call(Request::Connect(req))
329 .await
330 .map_err(|e| Status::new(
331 Code::Unknown,
332 format!("Error calling method Connect: {:?}", e)))?;
333 match result {
334 Response::Connect(r) => {
335 trace!("connect_peer response: {:?}", r);
336 Ok(tonic::Response::new(r.into()))
337 },
338 r => Err(Status::new(
339 Code::Internal,
340 format!(
341 "Unexpected result {:?} to method call Connect",
342 r
343 )
344 )),
345 }
346
347}
348
349async fn create_invoice(
350 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected