aboutsummaryrefslogtreecommitdiff
path: root/src/external_signer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/external_signer.h')
-rw-r--r--src/external_signer.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/external_signer.h b/src/external_signer.h
index 17428ba2f9..b3b202091a 100644
--- a/src/external_signer.h
+++ b/src/external_signer.h
@@ -5,17 +5,15 @@
#ifndef BITCOIN_EXTERNAL_SIGNER_H
#define BITCOIN_EXTERNAL_SIGNER_H
-#include <stdexcept>
-#include <string>
#include <univalue.h>
#include <util/system.h>
-struct PartiallySignedTransaction;
+#include <string>
+#include <vector>
-class ExternalSignerException : public std::runtime_error {
-public:
- using std::runtime_error::runtime_error;
-};
+#ifdef ENABLE_EXTERNAL_SIGNER
+
+struct PartiallySignedTransaction;
//! Enables interaction with an external signing device or service, such as
//! a hardware wallet. See doc/external-signer.md
@@ -30,7 +28,7 @@ public:
//! @param[in] fingerprint master key fingerprint of the signer
//! @param[in] chain "main", "test", "regtest" or "signet"
//! @param[in] name device name
- ExternalSigner(const std::string& command, const std::string& fingerprint, std::string chain, std::string name);
+ ExternalSigner(const std::string& command, const std::string& fingerprint, const std::string chain, const std::string name);
//! Master key fingerprint of the signer
std::string m_fingerprint;
@@ -43,13 +41,12 @@ public:
const std::string NetworkArg() const;
-#ifdef ENABLE_EXTERNAL_SIGNER
//! Obtain a list of signers. Calls `<command> enumerate`.
//! @param[in] command the command which handles interaction with the external signer
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
//! @param chain "main", "test", "regtest" or "signet"
//! @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, const std::string chain);
//! Display address on the device. Calls `<command> displayaddress --desc <descriptor>`.
//! @param[in] descriptor Descriptor specifying which address to display.
@@ -60,14 +57,14 @@ public:
//! Calls `<command> getdescriptors --account <account>`
//! @param[in] account which BIP32 account to use (e.g. `m/44'/0'/account'`)
//! @returns see doc/external-signer.md
- UniValue GetDescriptors(int account);
+ UniValue GetDescriptors(const int account);
//! Sign PartiallySignedTransaction on the device.
//! Calls `<command> signtransaction` and passes the PSBT via stdin.
//! @param[in,out] psbt PartiallySignedTransaction to be signed
bool SignTransaction(PartiallySignedTransaction& psbt, std::string& error);
-
-#endif
};
+#endif // ENABLE_EXTERNAL_SIGNER
+
#endif // BITCOIN_EXTERNAL_SIGNER_H