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

Method list_channels

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

Source from the content-addressed store, hash-verified

155}
156
157async fn list_channels(
158 &self,
159 request: tonic::Request<pb::ListchannelsRequest>,
160) -> Result<tonic::Response<pb::ListchannelsResponse>, tonic::Status> {
161 let req = request.into_inner();
162 let req: requests::ListchannelsRequest = req.into();
163 debug!("Client asked for list_channels");
164 trace!("list_channels request: {:?}", req);
165 let mut rpc = ClnRpc::new(&self.rpc_path)
166 .await
167 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
168 let result = rpc.call(Request::ListChannels(req))
169 .await
170 .map_err(|e| Status::new(
171 Code::Unknown,
172 format!("Error calling method ListChannels: {:?}", e)))?;
173 match result {
174 Response::ListChannels(r) => {
175 trace!("list_channels response: {:?}", r);
176 Ok(tonic::Response::new(r.into()))
177 },
178 r => Err(Status::new(
179 Code::Internal,
180 format!(
181 "Unexpected result {:?} to method call ListChannels",
182 r
183 )
184 )),
185 }
186
187}
188
189async fn add_gossip(
190 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected