mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
Merge #21666: Miscellaneous external signer changes
c8f469c6d5external_signer: remove ExternalSignerException (fanquake)9e0b199b97external_signer: use const where appropriate (fanquake)aaa4e5a45bwallet: remove CWallet::GetExternalSigner() (fanquake)06a0673351external_signer: remove ignore_errors from Enumerate() (fanquake)8fdbb899b8refactor: unify external wallet runtime errors (fanquake)f4652bf125refactor: add missing includes to external signer code (fanquake)54569cc6d6refactor: 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: tACKc8f469c6d5instagibbs: utACKc8f469c6d5Tree-SHA512: 3d5ac5df81680075e71e0e4a7595c520d746c3e37f016cf168c1e10da15541ebb1595aecaf2c08575636e9ff77d499644cae53180232b7049cfae0b923106e4e
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user