aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-09-26 21:43:44 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2020-01-14 09:34:35 +0000
commiteafcea7a0ab17512f2b9e2a724685ca193920f04 (patch)
treee8dd9f376a3359eb0a058b454451290d565c1465 /src/qt/bitcoingui.cpp
parent7e66d04770bfb21862e52736c4859d7a878cb906 (diff)
downloadbitcoin-eafcea7a0ab17512f2b9e2a724685ca193920f04.tar.xz
gui: Fix duplicate wallet showing up
The slot BitcoinGUI::addWallet can be invoked twice for the same WalletModel due to a concurrent wallet being loaded after the first `connect()`: ```cpp connect(wallet_controller, &WalletController::walletAdded, this, &BitcoinGUI::addWallet); connect(wallet_controller, &WalletController::walletRemoved, this, &BitcoinGUI::removeWallet); for (WalletModel* wallet_model : m_wallet_controller->getOpenWallets()) { addWallet(wallet_model); ``` Github-Pull: #16963 Rebased-From: 6d6a7a8403ae923f189812edebdd95761de0e7f2
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index e269c91d1c..784fdcb6e5 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -633,10 +633,10 @@ void BitcoinGUI::setWalletController(WalletController* wallet_controller)
void BitcoinGUI::addWallet(WalletModel* walletModel)
{
if (!walletFrame) return;
+ if (!walletFrame->addWallet(walletModel)) return;
const QString display_name = walletModel->getDisplayName();
setWalletActionsEnabled(true);
rpcConsole->addWallet(walletModel);
- walletFrame->addWallet(walletModel);
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
if (m_wallet_selector->count() == 2) {
m_wallet_selector_label_action->setVisible(true);