aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authoramadeuszpawlik <apawlik@protonmail.com>2022-05-28 20:40:51 +0200
committeramadeuszpawlik <apawlik@protonmail.com>2022-06-09 20:34:46 +0200
commit292b1a3e9c98b9ba74b28d149df8554d4ad8e5c0 (patch)
treecbd0c09f79230f5d07ff0c3e03adf52825ad7959 /src/qt
parent8c61374ba782bfd328741fb7a46f32581e524ef6 (diff)
downloadbitcoin-292b1a3e9c98b9ba74b28d149df8554d4ad8e5c0.tar.xz
GetExternalSigner(): fail if multiple signers are found
If there are multiple external signers, `GetExternalSigner()` will just pick the first one in the list. If the user has two or more hardware wallets connected at the same time, he might not notice this. This PR adds a check and fails with suitable message.
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/walletcontroller.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp
index d27ddf1aba..fae4c7cdf1 100644
--- a/src/qt/walletcontroller.cpp
+++ b/src/qt/walletcontroller.cpp
@@ -293,6 +293,10 @@ void CreateWalletActivity::create()
} catch (const std::runtime_error& e) {
QMessageBox::critical(nullptr, tr("Can't list signers"), e.what());
}
+ if (signers.size() > 1) {
+ QMessageBox::critical(nullptr, tr("Too many external signers found"), QString::fromStdString("More than one external signer found. Please connect only one at a time."));
+ signers.clear();
+ }
m_create_wallet_dialog->setSigners(signers);
m_create_wallet_dialog->setWindowModality(Qt::ApplicationModal);