HomePhabricator

[electrum] deglobalize config

Description

[electrum] deglobalize config

Summary:
Now the config object is create in the main script and passed down via the Daemon to all the various components that need it.

The previous way of setting a singleton instance of the config consisted of overwriting the previous global config with a new one, but it didn't really enforce anything and just added even more inconsistency. Some functions used the config object created at application launch time passed down via the function params, other functions accessed the global config via get_config which could be the same as the one created initially or a new one instantiated later.

Right now in GUI mode everything uses the same config, the one created at the application start. In daemon mode, each RPC command still causes a new config to be instantiated and used for this one command. In practice this new config shares some configuration with the existing one (everything that is read from the disk file in which config is commited), and differs via the command line args passed to the client calling the RPC.

Depends on D18780

Test Plan:
python test_runner.py

Run the application, try various features that rely on configuration state (change configuration options and check it is persisted after restart)

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Oct 10 2025, 09:21
PiRKPushed on Oct 13 2025, 18:28
Reviewer
Restricted Project
Differential Revision
D18781: [electrum] deglobalize config
Parents
rABC669a85a5bddf: [e.cash] Update countdown time
Branches
Unknown
Tags
Unknown