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

Method get_route

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

Source from the content-addressed store, hash-verified

2229 }
2230
2231 async fn get_route(
2232 &self,
2233 request: tonic::Request<pb::GetrouteRequest>,
2234 ) -> Result<tonic::Response<pb::GetrouteResponse>, tonic::Status> {
2235 let req = request.into_inner();
2236 #[allow(deprecated)]
2237 let req: requests::GetrouteRequest = req.try_into()?;
2238 debug!("Client asked for get_route");
2239 trace!("get_route request: {:?}", req);
2240 let mut rpc = ClnRpc::new(&self.rpc_path)
2241 .await
2242 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
2243 let result = rpc.call(Request::GetRoute(req))
2244 .await
2245 .map_err(|e| Status::new(
2246 Code::Unknown,
2247 format!("Error calling method GetRoute: {:?}", e)))?;
2248 match result {
2249 Response::GetRoute(r) => {
2250 trace!("get_route response: {:?}", r);
2251 Ok(tonic::Response::new(r.into()))
2252 },
2253 r => Err(Status::new(
2254 Code::Internal,
2255 format!(
2256 "Unexpected result {:?} to method call GetRoute",
2257 r
2258 )
2259 )),
2260 }
2261
2262 }
2263
2264 async fn list_addresses(
2265 &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