From 68f8a3f7c7a65f759c5a594e166f04d2d90398ca Mon Sep 17 00:00:00 2001 From: lupin012 <58134934+lupin012@users.noreply.github.com> Date: Thu, 2 May 2024 11:47:30 +0200 Subject: [PATCH] rpcdaemon: erigon_getLatestLogs fix retrieving latest block (#1996) --- silkworm/rpc/core/logs_walker.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/silkworm/rpc/core/logs_walker.cpp b/silkworm/rpc/core/logs_walker.cpp index cf967a1048..d5cedf0641 100644 --- a/silkworm/rpc/core/logs_walker.cpp +++ b/silkworm/rpc/core/logs_walker.cpp @@ -44,20 +44,20 @@ Task> LogsWalker::get_block_numbers(const Filter& start = end = block_number; } } else { - uint64_t last_executed_block_number = std::numeric_limits::max(); + uint64_t last_block_number = std::numeric_limits::max(); if (filter.from_block.has_value()) { start = co_await core::get_block_number(filter.from_block.value(), tx_database_); } else { - last_executed_block_number = co_await core::get_latest_executed_block_number(tx_database_); - start = last_executed_block_number; + last_block_number = co_await core::get_latest_block_number(tx_database_); + start = last_block_number; } if (filter.to_block.has_value()) { end = co_await core::get_block_number(filter.to_block.value(), tx_database_); } else { - if (last_executed_block_number == std::numeric_limits::max()) { - last_executed_block_number = co_await core::get_latest_executed_block_number(tx_database_); + if (last_block_number == std::numeric_limits::max()) { + last_block_number = co_await core::get_latest_block_number(tx_database_); } - end = last_executed_block_number; + end = last_block_number; } } co_return std::make_pair(start, end);