diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-01-08 15:58:08 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-01-08 15:58:33 +0100 |
commit | 6196e930018181301b5972842ae384ea4288ff34 (patch) | |
tree | 303c601a23c55f03072baf03ea2b2bd4de2d86d4 /src/qt/walletframe.cpp | |
parent | 295211e668290d7741eb0fd46223087c21fc7c59 (diff) | |
parent | 6d6a7a8403ae923f189812edebdd95761de0e7f2 (diff) |
Merge #16963: wallet: Fix unique_ptr usage in boost::signals2
6d6a7a8403ae923f189812edebdd95761de0e7f2 gui: Fix duplicate wallet showing up (João Barbosa)
81ea66c30e2953dee24d5b127c28daa0d9452a28 Drop signal CClientUIInterface::LoadWallet (Russell Yanofsky)
Pull request description:
This PR includes 2 fixes:
- prevent GUI LoadWallet handlers from crashing on startup when multiple handlers are attached, because the first handler takes ownership of the wallet unique pointer. Now every handler will receive its own unique pointer;
- prevent showing a wallet twice in the GUI on startup due to a race with `loadwallet`.
Fixes #16937
ACKs for top commit:
fjahr:
code review ACK 6d6a7a8403ae923f189812edebdd95761de0e7f2
ryanofsky:
Code review ACK 6d6a7a8403ae923f189812edebdd95761de0e7f2. No changes since last ACK other than rebase due to #17070
kallewoof:
Code review ACK 6d6a7a8403ae923f189812edebdd95761de0e7f2
Tree-SHA512: 7f0658c9011f81dfa176a094c2263448ee1d14fda7dc94e8b55ee9c8b81538bd2d1e4bf8a8dbfcd029ebfc9feb6d3cda9dee3f911122df0a4b1e0ca75f653ba4
Diffstat (limited to 'src/qt/walletframe.cpp')
-rw-r--r-- | src/qt/walletframe.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 4b2b475883..f363d5ddc5 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -39,11 +39,11 @@ void WalletFrame::setClientModel(ClientModel *_clientModel) this->clientModel = _clientModel; } -void WalletFrame::addWallet(WalletModel *walletModel) +bool WalletFrame::addWallet(WalletModel *walletModel) { - if (!gui || !clientModel || !walletModel) return; + if (!gui || !clientModel || !walletModel) return false; - if (mapWalletViews.count(walletModel) > 0) return; + if (mapWalletViews.count(walletModel) > 0) return false; WalletView *walletView = new WalletView(platformStyle, this); walletView->setBitcoinGUI(gui); @@ -62,6 +62,8 @@ void WalletFrame::addWallet(WalletModel *walletModel) mapWalletViews[walletModel] = walletView; connect(walletView, &WalletView::outOfSyncWarningClicked, this, &WalletFrame::outOfSyncWarningClicked); + + return true; } void WalletFrame::setCurrentWallet(WalletModel* wallet_model) |