Skip to content

Commit 54569cc

Browse files
committed
refactor: move all signer code inside ENABLE_EXTERNAL_SIGNER #ifdefs
1 parent c1f480f commit 54569cc

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/external_signer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
#include <util/system.h>
1010
#include <external_signer.h>
1111

12+
#ifdef ENABLE_EXTERNAL_SIGNER
13+
1214
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) {}
1315

1416
const std::string ExternalSigner::NetworkArg() const
1517
{
1618
return " --chain " + m_chain;
1719
}
1820

19-
#ifdef ENABLE_EXTERNAL_SIGNER
20-
2121
bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, std::string chain, bool ignore_errors)
2222
{
2323
// Call <command> enumerate
@@ -116,4 +116,4 @@ bool ExternalSigner::SignTransaction(PartiallySignedTransaction& psbtx, std::str
116116
return true;
117117
}
118118

119-
#endif
119+
#endif // ENABLE_EXTERNAL_SIGNER

src/external_signer.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <univalue.h>
1111
#include <util/system.h>
1212

13+
#ifdef ENABLE_EXTERNAL_SIGNER
14+
1315
struct PartiallySignedTransaction;
1416

1517
class ExternalSignerException : public std::runtime_error {
@@ -43,7 +45,6 @@ class ExternalSigner
4345

4446
const std::string NetworkArg() const;
4547

46-
#ifdef ENABLE_EXTERNAL_SIGNER
4748
//! Obtain a list of signers. Calls `<command> enumerate`.
4849
//! @param[in] command the command which handles interaction with the external signer
4950
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
@@ -66,8 +67,8 @@ class ExternalSigner
6667
//! Calls `<command> signtransaction` and passes the PSBT via stdin.
6768
//! @param[in,out] psbt PartiallySignedTransaction to be signed
6869
bool SignTransaction(PartiallySignedTransaction& psbt, std::string& error);
69-
70-
#endif
7170
};
7271

72+
#endif // ENABLE_EXTERNAL_SIGNER
73+
7374
#endif // BITCOIN_EXTERNAL_SIGNER_H

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4586,7 +4586,7 @@ void CWallet::SetupDescriptorScriptPubKeyMans()
45864586
}
45874587
#else
45884588
throw std::runtime_error(std::string(__func__) + ": Wallets with external signers require Boost::Process library.");
4589-
#endif
4589+
#endif // ENABLE_EXTERNAL_SIGNER
45904590
}
45914591
}
45924592

0 commit comments

Comments
 (0)