diff options
author | amadeuszpawlik <apawlik@protonmail.com> | 2022-05-28 20:40:51 +0200 |
---|---|---|
committer | amadeuszpawlik <apawlik@protonmail.com> | 2022-06-09 20:34:46 +0200 |
commit | 292b1a3e9c98b9ba74b28d149df8554d4ad8e5c0 (patch) | |
tree | cbd0c09f79230f5d07ff0c3e03adf52825ad7959 /src/wallet/external_signer_scriptpubkeyman.cpp | |
parent | 8c61374ba782bfd328741fb7a46f32581e524ef6 (diff) | |
download | bitcoin-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/wallet/external_signer_scriptpubkeyman.cpp')
-rw-r--r-- | src/wallet/external_signer_scriptpubkeyman.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/external_signer_scriptpubkeyman.cpp b/src/wallet/external_signer_scriptpubkeyman.cpp index 9d5f58b784..76de51ac3e 100644 --- a/src/wallet/external_signer_scriptpubkeyman.cpp +++ b/src/wallet/external_signer_scriptpubkeyman.cpp @@ -45,7 +45,8 @@ ExternalSigner ExternalSignerScriptPubKeyMan::GetExternalSigner() { std::vector<ExternalSigner> signers; ExternalSigner::Enumerate(command, signers, Params().NetworkIDString()); if (signers.empty()) throw std::runtime_error(std::string(__func__) + ": No external signers found"); - // TODO: add fingerprint argument in case of multiple signers + // TODO: add fingerprint argument instead of failing in case of multiple signers. + if (signers.size() > 1) throw std::runtime_error(std::string(__func__) + ": More than one external signer found. Please connect only one at a time."); return signers[0]; } |