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

Method wait_block_height

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

Source from the content-addressed store, hash-verified

3320 }
3321
3322 async fn wait_block_height(
3323 &self,
3324 request: tonic::Request<pb::WaitblockheightRequest>,
3325 ) -> Result<tonic::Response<pb::WaitblockheightResponse>, tonic::Status> {
3326 let req = request.into_inner();
3327 let req: requests::WaitblockheightRequest = req.try_into()?;
3328 debug!("Client asked for wait_block_height");
3329 trace!("wait_block_height request: {:?}", req);
3330 let mut rpc = ClnRpc::new(&self.rpc_path)
3331 .await
3332 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
3333 let result = rpc.call(Request::WaitBlockHeight(req))
3334 .await
3335 .map_err(|e| Status::new(
3336 Code::Unknown,
3337 format!("Error calling method WaitBlockHeight: {:?}", e)))?;
3338 match result {
3339 Response::WaitBlockHeight(r) => {
3340 trace!("wait_block_height response: {:?}", r);
3341 Ok(tonic::Response::new(r.into()))
3342 },
3343 r => Err(Status::new(
3344 Code::Internal,
3345 format!(
3346 "Unexpected result {:?} to method call WaitBlockHeight",
3347 r
3348 )
3349 )),
3350 }
3351
3352 }
3353
3354 async fn wait(
3355 &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