diff options
Diffstat (limited to 'src/rpc/external_signer.cpp')
-rw-r--r-- | src/rpc/external_signer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rpc/external_signer.cpp b/src/rpc/external_signer.cpp index 0f8f197ad8..6ec2b1a07f 100644 --- a/src/rpc/external_signer.cpp +++ b/src/rpc/external_signer.cpp @@ -9,6 +9,9 @@ #include <util/strencodings.h> #include <rpc/protocol.h> +#include <string> +#include <vector> + #ifdef ENABLE_EXTERNAL_SIGNER static RPCHelpMan enumeratesigners() @@ -35,18 +38,18 @@ static RPCHelpMan enumeratesigners() { const std::string command = gArgs.GetArg("-signer", ""); if (command == "") throw JSONRPCError(RPC_MISC_ERROR, "Error: restart bitcoind with -signer=<cmd>"); - std::string chain = gArgs.GetChainName(); + const std::string chain = gArgs.GetChainName(); UniValue signers_res = UniValue::VARR; try { std::vector<ExternalSigner> signers; ExternalSigner::Enumerate(command, signers, chain); - for (ExternalSigner signer : signers) { + for (const ExternalSigner& signer : signers) { UniValue signer_res = UniValue::VOBJ; signer_res.pushKV("fingerprint", signer.m_fingerprint); signer_res.pushKV("name", signer.m_name); signers_res.push_back(signer_res); } - } catch (const ExternalSignerException& e) { + } catch (const std::exception& e) { throw JSONRPCError(RPC_MISC_ERROR, e.what()); } UniValue result(UniValue::VOBJ); |