mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
external_signer: remove ignore_errors from Enumerate()
This is undocumented and unused.
This commit is contained in:
parent
8fdbb899b8
commit
06a0673351
@ -21,19 +21,17 @@ const std::string ExternalSigner::NetworkArg() const
|
|||||||
return " --chain " + m_chain;
|
return " --chain " + m_chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, std::string chain, bool ignore_errors)
|
bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, std::string chain)
|
||||||
{
|
{
|
||||||
// Call <command> enumerate
|
// Call <command> enumerate
|
||||||
const UniValue result = RunCommandParseJSON(command + " enumerate");
|
const UniValue result = RunCommandParseJSON(command + " enumerate");
|
||||||
if (!result.isArray()) {
|
if (!result.isArray()) {
|
||||||
if (ignore_errors) return false;
|
|
||||||
throw ExternalSignerException(strprintf("'%s' received invalid response, expected array of signers", command));
|
throw ExternalSignerException(strprintf("'%s' received invalid response, expected array of signers", command));
|
||||||
}
|
}
|
||||||
for (UniValue signer : result.getValues()) {
|
for (UniValue signer : result.getValues()) {
|
||||||
// Check for error
|
// Check for error
|
||||||
const UniValue& error = find_value(signer, "error");
|
const UniValue& error = find_value(signer, "error");
|
||||||
if (!error.isNull()) {
|
if (!error.isNull()) {
|
||||||
if (ignore_errors) return false;
|
|
||||||
if (!error.isStr()) {
|
if (!error.isStr()) {
|
||||||
throw ExternalSignerException(strprintf("'%s' error", command));
|
throw ExternalSignerException(strprintf("'%s' error", command));
|
||||||
}
|
}
|
||||||
@ -42,7 +40,6 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS
|
|||||||
// Check if fingerprint is present
|
// Check if fingerprint is present
|
||||||
const UniValue& fingerprint = find_value(signer, "fingerprint");
|
const UniValue& fingerprint = find_value(signer, "fingerprint");
|
||||||
if (fingerprint.isNull()) {
|
if (fingerprint.isNull()) {
|
||||||
if (ignore_errors) return false;
|
|
||||||
throw ExternalSignerException(strprintf("'%s' received invalid response, missing signer fingerprint", command));
|
throw ExternalSignerException(strprintf("'%s' received invalid response, missing signer fingerprint", command));
|
||||||
}
|
}
|
||||||
std::string fingerprintStr = fingerprint.get_str();
|
std::string fingerprintStr = fingerprint.get_str();
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
|
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
|
||||||
//! @param chain "main", "test", "regtest" or "signet"
|
//! @param chain "main", "test", "regtest" or "signet"
|
||||||
//! @returns success
|
//! @returns success
|
||||||
static bool Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, std::string chain, bool ignore_errors = false);
|
static bool Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, std::string chain);
|
||||||
|
|
||||||
//! Display address on the device. Calls `<command> displayaddress --desc <descriptor>`.
|
//! Display address on the device. Calls `<command> displayaddress --desc <descriptor>`.
|
||||||
//! @param[in] descriptor Descriptor specifying which address to display.
|
//! @param[in] descriptor Descriptor specifying which address to display.
|
||||||
|
Loading…
Reference in New Issue
Block a user