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

Method list_channels

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

Source from the content-addressed store, hash-verified

211 }
212
213 async fn list_channels(
214 &self,
215 request: tonic::Request<pb::ListchannelsRequest>,
216 ) -> Result<tonic::Response<pb::ListchannelsResponse>, tonic::Status> {
217 let req = request.into_inner();
218 let req: requests::ListchannelsRequest = req.into();
219 debug!("Client asked for list_channels");
220 trace!("list_channels request: {:?}", req);
221 let mut rpc = ClnRpc::new(&self.rpc_path)
222 .await
223 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
224 let result = rpc.call(Request::ListChannels(req))
225 .await
226 .map_err(|e| Status::new(
227 Code::Unknown,
228 format!("Error calling method ListChannels: {:?}", e)))?;
229 match result {
230 Response::ListChannels(r) => {
231 trace!("list_channels response: {:?}", r);
232 Ok(tonic::Response::new(r.into()))
233 },
234 r => Err(Status::new(
235 Code::Internal,
236 format!(
237 "Unexpected result {:?} to method call ListChannels",
238 r
239 )
240 )),
241 }
242
243 }
244
245 async fn add_gossip(
246 &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