Skip to content

Encode the rest block hash by height text as a hash. - #1188

Merged
evoskuil merged 1 commit into
libbitcoin:masterfrom
echennells:fix/rest-blockhash-hex
Nov 18, 2026
Merged

evoskuil merged 1 commit into
libbitcoin:masterfrom
echennells:fix/rest-blockhash-hex

Conversation

@echennells

Copy link
Copy Markdown
Contributor

GET /rest/blockhashbyheight/<height>.hex returned encode_base16(hash), the serialized byte order. bitcoind returns the display order (GetHex()), which is the string the .json form already returns, so the two text forms disagreed for every block. The .bin form is unchanged.

The unit test expected the serialized order. It now expects block5, the display string the other tests in the file use.

The .hex form of /rest/blockhashbyheight returned the hash bytes in
serialized order. bitcoind returns the hash in display order, the same
string as the .json form.
@echennells
echennells requested a review from evoskuil November 17, 2026 21:56
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.201%. remained the same — echennells:fix/rest-blockhash-hex into libbitcoin:master

@evoskuil
evoskuil merged commit 8e2cfc5 into libbitcoin:master Nov 18, 2026
15 of 22 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.

3 participants