HomePhabricator

[chronik] Electrum: fix a potential deadlock in scripthash_or_address_suscribe

Description

[chronik] Electrum: fix a potential deadlock in scripthash_or_address_suscribe

Summary:
Because the returned status is computed after the task is started, there could be a lock issue with the indexer if an event occurs while the status is being computed. This is most likely to occur with a large wallet but can in theory happen for any subscription.

Computing the status before creating the task solves this issue entirely.

Test Plan:

./test/functional/test_runner.py chronik_*

Tested live against a watchonly IFP wallet.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Sep 1 2025, 09:03
FabienPushed on Sep 5 2025, 08:03
Reviewer
Restricted Project
Differential Revision
D18555: [chronik] Electrum: fix a potential deadlock in scripthash_or_address_suscribe
Parents
rABCd3339e23dbba: [chronik] fix blockchain.block.headers electrum endpoint
Branches
Unknown
Tags
Unknown