Skip to content

fix: blockchain.block.header returns plain hex string when cp_height is zero#745

Merged
evoskuil merged 2 commits intolibbitcoin:masterfrom
eynhaender:master
May 8, 2026
Merged

fix: blockchain.block.header returns plain hex string when cp_height is zero#745
evoskuil merged 2 commits intolibbitcoin:masterfrom
eynhaender:master

Conversation

@eynhaender
Copy link
Copy Markdown
Contributor

Per the Electrum protocol spec, blockchain.block.header must return a
plain hex string when cp_height is 0. The shared blockchain_block_headers()
implementation was unconditionally wrapping the result in an object,
causing Electrum clients (e.g. Sparrow) to fail parsing the response.

Two fixes in blockchain_block_headers():

  • Add early return for the no-proof singular case that sends a plain
    std::string via send_result() instead of building an object_t.
  • Fix the pre-v1.6 proof dict to use "header" for the singular case;
    "hex" is only correct for the plural (concatenated) response.

@evoskuil evoskuil merged commit ccdfcdd into libbitcoin:master May 8, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants