Bitcoind 29.0 added additional error messages for getblock, updating#186
Merged
philippem merged 1 commit intoBlockstream:new-indexfrom Feb 26, 2026
Merged
Conversation
2017ae6 to
f7a4430
Compare
f7a4430 to
44b1440
Compare
Randy808
approved these changes
Feb 26, 2026
philippem
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We saw this panic in our electrs:
That line of code in daemon.rs was checking an error message string to retry or panic:
if err_msg.contains("Block not found on disk")Found that:
That new error messages that start with "Block not available" were introduced in commit 5290cbd58504dcbab97cb0944b3ae0a0f79c4502 by Martin Zumsande on July 8, 2024.
Here are the details:
Commit: 5290cbd5 — "rpc: Improve getblock / getblockstats error when only header is available."
PR: bitcoin/bitcoin#30410
— "rpc, rest: Improve block rpc error handling, check header before attempting to read block data."
Purpose: The commit improves the error message returned by the getblock and getblockstats RPCs. Before this change, if a node only had the block header (but not the full block data), the code would still attempt ReadRawBlockFromDisk(), which would fail with a less informative error. This change checks the header's nStatus field first and returns the clearer "Block not available (not fully downloaded)" message instead.
First release: This was first included in Bitcoin Core v29.0.
The error lives in src/rpc/blockchain.cpp at line 682 (on the current master branch).
Adding code to look for both strings to support all 3 getblock errors.