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

Method close

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

Source from the content-addressed store, hash-verified

403 }
404
405 async fn close(
406 &self,
407 request: tonic::Request<pb::CloseRequest>,
408 ) -> Result<tonic::Response<pb::CloseResponse>, tonic::Status> {
409 let req = request.into_inner();
410 let req: requests::CloseRequest = req.into();
411 debug!("Client asked for close");
412 trace!("close request: {:?}", req);
413 let mut rpc = ClnRpc::new(&self.rpc_path)
414 .await
415 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
416 let result = rpc.call(Request::Close(req))
417 .await
418 .map_err(|e| Status::new(
419 Code::Unknown,
420 format!("Error calling method Close: {:?}", e)))?;
421 match result {
422 Response::Close(r) => {
423 trace!("close response: {:?}", r);
424 Ok(tonic::Response::new(r.into()))
425 },
426 r => Err(Status::new(
427 Code::Internal,
428 format!(
429 "Unexpected result {:?} to method call Close",
430 r
431 )
432 )),
433 }
434
435 }
436
437 async fn connect_peer(
438 &self,

Callers

nothing calls this directly

Calls 3

into_innerMethod · 0.80
to_stringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected