HomePhabricator

[electrum] fix auxiliary key dialog initialization on first use

Description

[electrum] fix auxiliary key dialog initialization on first use

Summary:
When no key was ever used, the index is still 0. The default value of a QSpinBox is 0, so the valueChanged signal is not emitted when setting the index, and the keys are not filled until the user increments the spinbox manually.

Fix this by calling the slot manually when the index is 0. Also rename the slot to something more descriptive than onIndexChanged.

Also remove some unneeded synchronization code. The only thing calling this slot is the signal emitted by the spinbox or the new call added in this diff (when the spinbox's value is already 0), so no need to update the spinbox.

Test Plan: Open the "Show auxiliary keys" tool in the Wallet menu in a wallet that never generated a proof or a delegation and never displayed this tool. Check that the keys are properly shown for index 0.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
PiRKAuthored on Nov 16 2023, 15:19
PiRKPushed on Nov 17 2023, 12:44
Reviewer
Restricted Project
Differential Revision
D14803: [electrum] fix auxiliary key dialog initialization on first use
Parents
rABCb337563691f8: [electrum] fix delegator key detection when building multi-level delegation
Branches
Unknown
Tags
Unknown