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

Method close

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

Source from the content-addressed store, hash-verified

283}
284
285async fn close(
286 &self,
287 request: tonic::Request<pb::CloseRequest>,
288) -> Result<tonic::Response<pb::CloseResponse>, tonic::Status> {
289 let req = request.into_inner();
290 let req: requests::CloseRequest = req.into();
291 debug!("Client asked for close");
292 trace!("close request: {:?}", req);
293 let mut rpc = ClnRpc::new(&self.rpc_path)
294 .await
295 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
296 let result = rpc.call(Request::Close(req))
297 .await
298 .map_err(|e| Status::new(
299 Code::Unknown,
300 format!("Error calling method Close: {:?}", e)))?;
301 match result {
302 Response::Close(r) => {
303 trace!("close response: {:?}", r);
304 Ok(tonic::Response::new(r.into()))
305 },
306 r => Err(Status::new(
307 Code::Internal,
308 format!(
309 "Unexpected result {:?} to method call Close",
310 r
311 )
312 )),
313 }
314
315}
316
317async fn connect_peer(
318 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected