Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon RPC: /getblocks.bin return chain's top_block_hash in resp #9383

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

j-berman
Copy link
Collaborator

Particularly useful in combination with #9382, so that the client can be certain it's on the correct chain even when the request to /getblocks.bin includes a start_height > chain tip

Used in the Seraphis lib async scanner: UkoeHB#23

@@ -2774,7 +2774,10 @@ bool Blockchain::find_blockchain_supplement(const uint64_t req_start_block, cons
if(req_start_block > 0)
{
// if requested height is higher than our chain, return false -- we can't help
if (req_start_block >= m_db->height())
uint64_t top_height;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but you really don't need the temporary top_height here or below. Just give total_height to top_block_hash then ++total_height.

@selsta selsta added the daemon label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants