HomePhabricator

[chronik] fix blockchain.block.headers electrum endpoint

Description

[chronik] fix blockchain.block.headers electrum endpoint

Summary:
We accidentaly returned an error when more than 500 headers were requested. The limit relevant to the Electrum protocol is 2016, and to match Fulcrum's behavior we don't return an error if we exceed it, we just cap the number of headers to 2016.

Depends on D18563

Test Plan:
ninja check-functional

Test it locally on mainnet:

./src/bitcoind  -chronik  -chronikelectrumbind="127.0.0.1:50001:t"
echo '{"jsonrpc": "2.0", "method": "blockchain.block.headers", "params": [800000, 2016], "id": "test"}' | nc 127.0.0.1 50001

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18562

Details

Provenance
PiRKAuthored on Sep 4 2025, 09:21
PiRKPushed on Sep 4 2025, 19:37
Reviewer
Restricted Project
Differential Revision
D18562: [chronik] fix blockchain.block.headers electrum endpoint
Parents
rABCc9ac46c718a7: [Cashtab] Patch spinner issue for first time users with no wallet
Branches
Unknown
Tags
Unknown