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

Conversation

Projects
None yet
6 participants
@promag
Copy link
Member

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.

Show resolved Hide resolved src/qt/bitcoingui.cpp Outdated

@MarcoFalke MarcoFalke added the GUI label Feb 22, 2019

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Feb 22, 2019

@DrahtBot

This comment has been minimized.

Copy link
Contributor

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

left a comment

tACK 01e25ff

Show resolved Hide resolved src/qt/bitcoingui.cpp Outdated

@promag promag force-pushed the promag:2019-02-fix-15455 branch from 01e25ff to a720a98 Feb 23, 2019

@fanquake

This comment has been minimized.

Copy link
Member

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);

This comment has been minimized.

Copy link
@laanwj

laanwj Feb 27, 2019

Member

When can this fail?

This comment has been minimized.

Copy link
@promag

promag Feb 27, 2019

Author Member

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

This comment has been minimized.

Copy link
@laanwj

laanwj Feb 27, 2019

Member

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

@laanwj

This comment has been minimized.

Copy link
Member

commented Feb 27, 2019

utACK a720a98

@laanwj laanwj merged commit a720a98 into bitcoin:master Feb 27, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Feb 27, 2019

Merge #15462: gui: Fix async open wallet call order
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.