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

Method list_peers

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

Source from the content-addressed store, hash-verified

59}
60
61async fn list_peers(
62 &self,
63 request: tonic::Request<pb::ListpeersRequest>,
64) -> Result<tonic::Response<pb::ListpeersResponse>, tonic::Status> {
65 let req = request.into_inner();
66 let req: requests::ListpeersRequest = req.into();
67 debug!("Client asked for list_peers");
68 trace!("list_peers request: {:?}", req);
69 let mut rpc = ClnRpc::new(&self.rpc_path)
70 .await
71 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
72 let result = rpc.call(Request::ListPeers(req))
73 .await
74 .map_err(|e| Status::new(
75 Code::Unknown,
76 format!("Error calling method ListPeers: {:?}", e)))?;
77 match result {
78 Response::ListPeers(r) => {
79 trace!("list_peers response: {:?}", r);
80 Ok(tonic::Response::new(r.into()))
81 },
82 r => Err(Status::new(
83 Code::Internal,
84 format!(
85 "Unexpected result {:?} to method call ListPeers",
86 r
87 )
88 )),
89 }
90
91}
92
93async fn list_funds(
94 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected