diff options
author | fanquake <fanquake@gmail.com> | 2021-04-14 09:36:41 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-04-14 10:08:26 +0800 |
commit | e7af2f35af95f4ca51e38c8ac5b05cad8be22489 (patch) | |
tree | 191cd91c793101317f8b0c23d038aa8cbc95c3cd /src/rpc | |
parent | a1f0b8b62eb851c837a3618583b7c2fd4d12006c (diff) | |
parent | c8f469c6d50a8db6d92f0aed47a5d1cc82f30f7f (diff) | |
download | bitcoin-e7af2f35af95f4ca51e38c8ac5b05cad8be22489.tar.xz |
Merge #21666: Miscellaneous external signer changes
c8f469c6d50a8db6d92f0aed47a5d1cc82f30f7f external_signer: remove ExternalSignerException (fanquake)
9e0b199b976617edeb1c58d4203df5f83a26c1e3 external_signer: use const where appropriate (fanquake)
aaa4e5a45bd9ec5563ffa7b9e0d46d2de3cb9242 wallet: remove CWallet::GetExternalSigner() (fanquake)
06a0673351282fff1673f3679a7cad9a7faaf987 external_signer: remove ignore_errors from Enumerate() (fanquake)
8fdbb899b84a2be85e632e45f08b222db02395d9 refactor: unify external wallet runtime errors (fanquake)
f4652bf1259d5c52ff0d500c732f40ba41256817 refactor: add missing includes to external signer code (fanquake)
54569cc6d6f54788169061004026e62e1c08440e refactor: move all signer code inside ENABLE_EXTERNAL_SIGNER #ifdefs (fanquake)
Pull request description:
These are a few followups after #21467.
ACKs for top commit:
Sjors:
tACK c8f469c6d50a8db6d92f0aed47a5d1cc82f30f7f
instagibbs:
utACK https://github.com/bitcoin/bitcoin/pull/21666/commits/c8f469c6d50a8db6d92f0aed47a5d1cc82f30f7f
Tree-SHA512: 3d5ac5df81680075e71e0e4a7595c520d746c3e37f016cf168c1e10da15541ebb1595aecaf2c08575636e9ff77d499644cae53180232b7049cfae0b923106e4e
Diffstat (limited to 'src/rpc')
-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); |