HomePhabricator

[electrum] extract get_fulcrum_stat from poll_for_answer

Description

[electrum] extract get_fulcrum_stat from poll_for_answer

Summary:
The use case for poll_for_answer without a json_req is limited to polling Fulcrum stats. Extract this use case into its own function to remove one level of indentation.
This is a first step in making poll_for_answer less convoluted. The next commit will remove more indentation levels and the unnecessary retry flag.

There is no change in behavior, as wait_until uses the same timeout and poll intervall as poll_for_answer by default, and Fulcrum should be up and running after bitcoind_rpc_connection so the "Controller.Chain" check should not need more than a single poll .

Test Plan: pytest electrumabc/tests/regtest

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Nov 22 2023, 15:30
PiRKPushed on Nov 22 2023, 19:02
Reviewer
Restricted Project
Differential Revision
D14838: [electrum] extract get_fulcrum_stat from poll_for_answer
Parents
rABC39cd9dafffc6: [avalanche] Actually dump/load the peers list upon shutdown/startup
Branches
Unknown
Tags
Unknown