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

Method list_nodes

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

Source from the content-addressed store, hash-verified

1204 }
1205
1206 async fn list_nodes(
1207 &self,
1208 request: tonic::Request<pb::ListnodesRequest>,
1209 ) -> Result<tonic::Response<pb::ListnodesResponse>, tonic::Status> {
1210 let req = request.into_inner();
1211 let req: requests::ListnodesRequest = req.try_into()?;
1212 debug!("Client asked for list_nodes");
1213 trace!("list_nodes request: {:?}", req);
1214 let mut rpc = ClnRpc::new(&self.rpc_path)
1215 .await
1216 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
1217 let result = rpc.call(Request::ListNodes(req))
1218 .await
1219 .map_err(|e| Status::new(
1220 Code::Unknown,
1221 format!("Error calling method ListNodes: {:?}", e)))?;
1222 match result {
1223 Response::ListNodes(r) => {
1224 trace!("list_nodes response: {:?}", r);
1225 Ok(tonic::Response::new(r.into()))
1226 },
1227 r => Err(Status::new(
1228 Code::Internal,
1229 format!(
1230 "Unexpected result {:?} to method call ListNodes",
1231 r
1232 )
1233 )),
1234 }
1235
1236 }
1237
1238 async fn wait_any_invoice(
1239 &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