Page MenuHomePhabricator

[electrum] extract get_fulcrum_stat from poll_for_answer
ClosedPublic

Authored by PiRK on Nov 22 2023, 16:08.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC68088fe66a6c: [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

Diff Detail

Event Timeline

PiRK requested review of this revision.Nov 22 2023, 16:08

Note that the regtests are currently flaky (failing about 20% of the time) . I'm still investigating this issue, and this simplification should make my debugging easier.

This revision is now accepted and ready to land.Nov 22 2023, 16:30