mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
refactor: move all signer code inside ENABLE_EXTERNAL_SIGNER #ifdefs
This commit is contained in:
parent
c1f480fb23
commit
54569cc6d6
3 changed files with 8 additions and 7 deletions
|
@ -9,6 +9,8 @@
|
|||
#include <util/system.h>
|
||||
#include <external_signer.h>
|
||||
|
||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||
|
||||
ExternalSigner::ExternalSigner(const std::string& command, const std::string& fingerprint, std::string chain, std::string name): m_command(command), m_fingerprint(fingerprint), m_chain(chain), m_name(name) {}
|
||||
|
||||
const std::string ExternalSigner::NetworkArg() const
|
||||
|
@ -16,8 +18,6 @@ const std::string ExternalSigner::NetworkArg() const
|
|||
return " --chain " + m_chain;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||
|
||||
bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, std::string chain, bool ignore_errors)
|
||||
{
|
||||
// Call <command> enumerate
|
||||
|
@ -116,4 +116,4 @@ bool ExternalSigner::SignTransaction(PartiallySignedTransaction& psbtx, std::str
|
|||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // ENABLE_EXTERNAL_SIGNER
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <univalue.h>
|
||||
#include <util/system.h>
|
||||
|
||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||
|
||||
struct PartiallySignedTransaction;
|
||||
|
||||
class ExternalSignerException : public std::runtime_error {
|
||||
|
@ -43,7 +45,6 @@ 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
|
||||
|
@ -66,8 +67,8 @@ public:
|
|||
//! 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
|
||||
|
|
|
@ -4586,7 +4586,7 @@ void CWallet::SetupDescriptorScriptPubKeyMans()
|
|||
}
|
||||
#else
|
||||
throw std::runtime_error(std::string(__func__) + ": Wallets with external signers require Boost::Process library.");
|
||||
#endif
|
||||
#endif // ENABLE_EXTERNAL_SIGNER
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue