From 0b57384743f1b3e9beb99b3b674c45da4a8b8801 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Mon, 27 May 2024 13:56:46 -0400 Subject: [PATCH] geyser: fix getLatestBlockhash unary method (#349) --- CHANGELOG.md | 2 ++ yellowstone-grpc-geyser/src/grpc.rs | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 148e4d8b..cf5185fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The minor version will be incremented upon a breaking change and the patch versi ### Fixes +- geyser: fix getLatestBlockhash unary method ([#349](https://github.com/rpcpool/yellowstone-grpc/pull/349)) + ### Features ### Breaking diff --git a/yellowstone-grpc-geyser/src/grpc.rs b/yellowstone-grpc-geyser/src/grpc.rs index 0e0af0f6..e5d0a600 100644 --- a/yellowstone-grpc-geyser/src/grpc.rs +++ b/yellowstone-grpc-geyser/src/grpc.rs @@ -1387,13 +1387,14 @@ impl Geyser for GrpcService { blocks_meta .get_block( |block| { - block.block_height.map(|last_valid_block_height| { - GetLatestBlockhashResponse { + block + .block_height + .map(|block_height| GetLatestBlockhashResponse { slot: block.slot, blockhash: block.blockhash.clone(), - last_valid_block_height, - } - }) + last_valid_block_height: block_height + + MAX_RECENT_BLOCKHASHES as u64, + }) }, request.get_ref().commitment, )