Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Fix async open wallet call order #15462

Merged
merged 1 commit into from Feb 27, 2019
Merged

Conversation

@promag
Copy link
Member

@promag promag commented Feb 22, 2019

Fixes #15455. Must call OpenWalletActivity::open asynchronously only after all connections are made to the OpenWalletActivity instance, otherwise signals can be missed.

src/qt/bitcoingui.cpp Outdated Show resolved Hide resolved
@MarcoFalke MarcoFalke added the GUI label Feb 22, 2019
@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Feb 22, 2019
@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Feb 22, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15478 (wip: gui: Refactor open wallet activity by promag)
  • #15204 (gui: Add Open External Wallet action by promag)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Sjors
Sjors approved these changes Feb 23, 2019
Copy link
Member

@Sjors Sjors left a comment

tACK 01e25ff

src/qt/bitcoingui.cpp Outdated Show resolved Hide resolved
@promag promag force-pushed the 2019-02-fix-15455 branch from 01e25ff to a720a98 Feb 23, 2019
@fanquake
Copy link
Member

@fanquake fanquake commented Feb 26, 2019

tACK a720a98.

Checked this fixes #15455, and that 🦹🏿‍♂️ wallets load correctly.

@@ -396,6 +396,8 @@ void BitcoinGUI::createActions()
connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet);
connect(activity, &OpenWalletActivity::finished, activity, &QObject::deleteLater);
connect(activity, &OpenWalletActivity::finished, dialog, &QObject::deleteLater);
bool invoked = QMetaObject::invokeMethod(activity, "open");
assert(invoked);
Copy link
Member

@laanwj laanwj Feb 27, 2019

When can this fail?

Copy link
Member Author

@promag promag Feb 27, 2019

If the slot is renamed it would still compile. With Qt 5.10 it is possible to invoke like QMetaObject::invokeMethod(activity, &OpenWalletActivity::open).

Copy link
Member

@laanwj laanwj Feb 27, 2019

Thanks! (I think an assertion is in-order then, if only a compile-time bug can trigger it)

@laanwj
Copy link
Member

@laanwj laanwj commented Feb 27, 2019

utACK a720a98

@laanwj laanwj merged commit a720a98 into bitcoin:master Feb 27, 2019
2 checks passed
laanwj added a commit that referenced this issue Feb 27, 2019
a720a98 gui: Fix async open wallet call order (João Barbosa)

Pull request description:

  Fixes #15455. Must call `OpenWalletActivity::open` asynchronously only after all connections are made to the `OpenWalletActivity` instance, otherwise signals can be missed.

Tree-SHA512: 4e5fdbd09d2ca017ed07a1813c2707c09f96275f1498779804e322e0a4dbd7dcff0c2e9cd6ec18463cd427b88b192a8d02373de9edc2b03ba5e4b8484b264417
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue May 21, 2020
Summary:
bitcoin/bitcoin@a720a98

Depends on D6175

Backport of Core [[bitcoin/bitcoin#15462 | PR15462]]

Test Plan:
  ninja
  ./src/qt/bitcoin-qt -regtest

Open/close a wallet, UI behaves as expected

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6177
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Oct 25, 2021
a720a98 gui: Fix async open wallet call order (João Barbosa)

Pull request description:

  Fixes bitcoin#15455. Must call `OpenWalletActivity::open` asynchronously only after all connections are made to the `OpenWalletActivity` instance, otherwise signals can be missed.

Tree-SHA512: 4e5fdbd09d2ca017ed07a1813c2707c09f96275f1498779804e322e0a4dbd7dcff0c2e9cd6ec18463cd427b88b192a8d02373de9edc2b03ba5e4b8484b264417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants