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

Method list_peers

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

Source from the content-addressed store, hash-verified

115 }
116
117 async fn list_peers(
118 &self,
119 request: tonic::Request<pb::ListpeersRequest>,
120 ) -> Result<tonic::Response<pb::ListpeersResponse>, tonic::Status> {
121 let req = request.into_inner();
122 let req: requests::ListpeersRequest = req.into();
123 debug!("Client asked for list_peers");
124 trace!("list_peers request: {:?}", req);
125 let mut rpc = ClnRpc::new(&self.rpc_path)
126 .await
127 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
128 let result = rpc.call(Request::ListPeers(req))
129 .await
130 .map_err(|e| Status::new(
131 Code::Unknown,
132 format!("Error calling method ListPeers: {:?}", e)))?;
133 match result {
134 Response::ListPeers(r) => {
135 trace!("list_peers response: {:?}", r);
136 Ok(tonic::Response::new(r.into()))
137 },
138 r => Err(Status::new(
139 Code::Internal,
140 format!(
141 "Unexpected result {:?} to method call ListPeers",
142 r
143 )
144 )),
145 }
146
147 }
148
149 async fn list_funds(
150 &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