Skip to content

Commit 7c561be

Browse files
committed
Merge bitcoin/bitcoin#21935: Enable external signer support by default, reduce #ifdef
2f5bdcb gui: misc external signer fixes and translation hints (Sjors Provoost) d672404 refactor: make ExternalSigner NetworkArg() and m_chain private (Sjors Provoost) 4455145 refactor: reduce #ifdef ENABLE_EXTERNAL_SIGNER usage (Sjors Provoost) 5be90c9 build: enable external signer by default (Sjors Provoost) 7d94530 refactor: clean up external_signer.h includes (Sjors Provoost) fc0eca3 fuzz: fix fuzz binary linking order (Sjors Provoost) Pull request description: This follows the introduction of GUI support in #4 I don't think we should expect GUI users to self compile. This also enables external signer support by default for RPC users. In addition this PR reduces the number of `#ifdef ENABLE_EXTERNAL_SIGNER`, which also fixes #21919. When compiled with `--disable-external-signer` such wallets can't be created in RPC or GUI, but they can be loaded. Attempting any action that calls HWI will trigger an error. Side-note: this PR may or may not (currently) break CI for the GUI repository, as explained here: #4 (comment) ACKs for top commit: achow101: ACK 2f5bdcb hebasto: re-ACK 2f5bdcb Tree-SHA512: 1b71c5a8bea2be077ee9fa33a01130c957a0cf90951d4b7b04d3d0ef826bb77e474c3963abddfef2e2c1ea99d9c72cd2302d1eb9b5fcb7ba0bd2a625f006aa05
2 parents 65c4a36 + 2f5bdcb commit 7c561be

30 files changed

+56
-75
lines changed

ci/test/00_setup_env_arm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ export RUN_FUNCTIONAL_TESTS=false
2525
export GOAL="install"
2626
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
2727
# This could be removed once the ABI change warning does not show up by default
28-
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CXXFLAGS=-Wno-psabi --enable-external-signer"
28+
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CXXFLAGS=-Wno-psabi"

ci/test/00_setup_env_i686_centos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export CONTAINER_NAME=ci_i686_centos_8
1111
export DOCKER_NAME_TAG=centos:8
1212
export DOCKER_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python3-zmq which patch lbzip2 dash rsync coreutils bison"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports --enable-external-signer"
14+
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports"
1515
export CONFIG_SHELL="/bin/dash"
1616
export TEST_RUNNER_ENV="LC_ALL=en_US.UTF-8"

ci/test/00_setup_env_mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ export XCODE_BUILD_ID=12A7403
1515
export RUN_UNIT_TESTS=false
1616
export RUN_FUNCTIONAL_TESTS=false
1717
export GOAL="deploy"
18-
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --enable-external-signer"
18+
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports"

ci/test/00_setup_env_mac_host.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export HOST=x86_64-apple-darwin18
1010
export PIP_PACKAGES="zmq lief"
1111
export GOAL="install"
12-
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --enable-external-signer"
12+
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports"
1313
export CI_OS_NAME="macos"
1414
export NO_DEPENDS=1
1515
export OSX_SDK=""

ci/test/00_setup_env_native_asan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-
1111
export DOCKER_NAME_TAG=ubuntu:hirsute
1212
export NO_DEPENDS=1
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++ --enable-external-signer"
14+
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"

ci/test/00_setup_env_native_fuzz.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export RUN_UNIT_TESTS=false
1414
export RUN_FUNCTIONAL_TESTS=false
1515
export RUN_FUZZ_TESTS=true
1616
export GOAL="install"
17-
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer CC=clang CXX=clang++ --enable-external-signer"
17+
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer CC=clang CXX=clang++"
1818
export CCACHE_SIZE=200M

ci/test/00_setup_env_native_multiprocess.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export DOCKER_NAME_TAG=ubuntu:20.04
1111
export PACKAGES="cmake python3 python3-pip llvm clang"
1212
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-external-signer --enable-debug CC=clang CXX=clang++" # Use clang to avoid OOM
14+
export BITCOIN_CONFIG="--enable-debug CC=clang CXX=clang++" # Use clang to avoid OOM
1515
export TEST_RUNNER_ENV="BITCOIND=bitcoin-node"
1616
export RUN_SECURITY_TESTS="true"
1717
export PIP_PACKAGES="lief"

ci/test/00_setup_env_native_nowallet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export DOCKER_NAME_TAG=ubuntu:18.04 # Use bionic to have one config run the tes
1111
export PACKAGES="python3-zmq clang-5.0 llvm-5.0" # Use clang-5 to test C++17 compatibility, see doc/dependencies.md
1212
export DEP_OPTS="NO_WALLET=1"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CC=clang-5.0 CXX=clang++-5.0 --enable-external-signer"
14+
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CC=clang-5.0 CXX=clang++-5.0"

ci/test/00_setup_env_native_qt5.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ export RUN_UNIT_TESTS="false"
1616
export GOAL="install"
1717
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.2 v0.18.1 v0.19.1"
1818
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports
19-
--enable-debug --disable-fuzz-binary CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" --enable-external-signer"
19+
--enable-debug --disable-fuzz-binary CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\""

ci/test/00_setup_env_native_tsan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export DOCKER_NAME_TAG=ubuntu:hirsute
1111
export PACKAGES="clang llvm libc++abi-dev libc++-dev python3-zmq"
1212
export DEP_OPTS="CC=clang CXX='clang++ -stdlib=libc++'"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-zmq --with-gui=no CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' CXXFLAGS='-g' --with-sanitizers=thread CC=clang CXX='clang++ -stdlib=libc++' --enable-external-signer"
14+
export BITCOIN_CONFIG="--enable-zmq --with-gui=no CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' CXXFLAGS='-g' --with-sanitizers=thread CC=clang CXX='clang++ -stdlib=libc++'"

ci/test/00_setup_env_s390x.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ export RUN_UNIT_TESTS=true
2323
export TEST_RUNNER_ENV="LC_ALL=C"
2424
export RUN_FUNCTIONAL_TESTS=true
2525
export GOAL="install"
26-
export BITCOIN_CONFIG="--enable-reduce-exports --with-incompatible-bdb --enable-external-signer"
26+
export BITCOIN_CONFIG="--enable-reduce-exports --with-incompatible-bdb"

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ AC_ARG_ENABLE([werror],
333333
[enable_werror=no])
334334

335335
AC_ARG_ENABLE([external-signer],
336-
[AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is no, requires Boost::Process)])],
336+
[AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is yes, requires Boost::Process)])],
337337
[use_external_signer=$enableval],
338-
[use_external_signer=no])
338+
[use_external_signer=yes])
339339

340340
AC_LANG_PUSH([C++])
341341

src/Makefile.test.include

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ BITCOIN_TEST_SUITE = \
3535
$(TEST_UTIL_H)
3636

3737
FUZZ_SUITE_LD_COMMON = \
38+
$(LIBTEST_UTIL) \
39+
$(LIBTEST_FUZZ) \
3840
$(LIBBITCOIN_SERVER) \
41+
$(LIBBITCOIN_WALLET) \
3942
$(LIBBITCOIN_COMMON) \
4043
$(LIBBITCOIN_UTIL) \
41-
$(LIBTEST_UTIL) \
42-
$(LIBTEST_FUZZ) \
4344
$(LIBBITCOIN_CONSENSUS) \
4445
$(LIBBITCOIN_CRYPTO) \
4546
$(LIBBITCOIN_CLI) \
@@ -160,7 +161,6 @@ BITCOIN_TESTS += \
160161
wallet/test/scriptpubkeyman_tests.cpp
161162

162163
FUZZ_SUITE_LD_COMMON +=\
163-
$(LIBBITCOIN_WALLET) \
164164
$(SQLITE_LIBS) \
165165
$(BDB_LIBS)
166166

src/external_signer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
#include <string>
1414
#include <vector>
1515

16-
#ifdef ENABLE_EXTERNAL_SIGNER
17-
18-
ExternalSigner::ExternalSigner(const std::string& command, const std::string& fingerprint, const std::string chain, const std::string name): m_command(command), m_fingerprint(fingerprint), m_chain(chain), m_name(name) {}
16+
ExternalSigner::ExternalSigner(const std::string& command, const std::string chain, const std::string& fingerprint, const std::string name): m_command(command), m_chain(chain), m_fingerprint(fingerprint), m_name(name) {}
1917

2018
const std::string ExternalSigner::NetworkArg() const
2119
{
@@ -55,7 +53,7 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS
5553
if (model_field.isStr() && model_field.getValStr() != "") {
5654
name += model_field.getValStr();
5755
}
58-
signers.push_back(ExternalSigner(command, fingerprintStr, chain, name));
56+
signers.push_back(ExternalSigner(command, chain, fingerprintStr, name));
5957
}
6058
return true;
6159
}
@@ -116,5 +114,3 @@ bool ExternalSigner::SignTransaction(PartiallySignedTransaction& psbtx, std::str
116114

117115
return true;
118116
}
119-
120-
#endif // ENABLE_EXTERNAL_SIGNER

src/external_signer.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include <string>
1212
#include <vector>
1313

14-
#ifdef ENABLE_EXTERNAL_SIGNER
15-
1614
struct PartiallySignedTransaction;
1715

1816
//! Enables interaction with an external signing device or service, such as
@@ -23,24 +21,24 @@ class ExternalSigner
2321
//! The command which handles interaction with the external signer.
2422
std::string m_command;
2523

24+
//! Bitcoin mainnet, testnet, etc
25+
std::string m_chain;
26+
27+
const std::string NetworkArg() const;
28+
2629
public:
2730
//! @param[in] command the command which handles interaction with the external signer
2831
//! @param[in] fingerprint master key fingerprint of the signer
2932
//! @param[in] chain "main", "test", "regtest" or "signet"
3033
//! @param[in] name device name
31-
ExternalSigner(const std::string& command, const std::string& fingerprint, const std::string chain, const std::string name);
34+
ExternalSigner(const std::string& command, const std::string chain, const std::string& fingerprint, const std::string name);
3235

3336
//! Master key fingerprint of the signer
3437
std::string m_fingerprint;
3538

36-
//! Bitcoin mainnet, testnet, etc
37-
std::string m_chain;
38-
3939
//! Name of signer
4040
std::string m_name;
4141

42-
const std::string NetworkArg() const;
43-
4442
//! Obtain a list of signers. Calls `<command> enumerate`.
4543
//! @param[in] command the command which handles interaction with the external signer
4644
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
@@ -65,6 +63,4 @@ class ExternalSigner
6563
bool SignTransaction(PartiallySignedTransaction& psbt, std::string& error);
6664
};
6765

68-
#endif // ENABLE_EXTERNAL_SIGNER
69-
7066
#endif // BITCOIN_EXTERNAL_SIGNER_H

src/interfaces/node.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ class Node
111111
//! Disconnect node by id.
112112
virtual bool disconnectById(NodeId id) = 0;
113113

114-
#ifdef ENABLE_EXTERNAL_SIGNER
115114
//! List external signers
116115
virtual std::vector<ExternalSigner> externalSigners() = 0;
117-
#endif
118116

119117
//! Get total bytes recv.
120118
virtual int64_t getTotalBytesRecv() = 0;

src/node/interfaces.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <banman.h>
77
#include <chain.h>
88
#include <chainparams.h>
9+
#include <external_signer.h>
910
#include <init.h>
1011
#include <interfaces/chain.h>
1112
#include <interfaces/handler.h>
@@ -170,16 +171,24 @@ class NodeImpl : public Node
170171
}
171172
return false;
172173
}
173-
#ifdef ENABLE_EXTERNAL_SIGNER
174174
std::vector<ExternalSigner> externalSigners() override
175175
{
176+
#ifdef ENABLE_EXTERNAL_SIGNER
176177
std::vector<ExternalSigner> signers = {};
177178
const std::string command = gArgs.GetArg("-signer", "");
178179
if (command == "") return signers;
179180
ExternalSigner::Enumerate(command, signers, Params().NetworkIDString());
180181
return signers;
182+
#else
183+
// This result is undistinguisable from a succesful call that returns
184+
// no signers. For the current GUI this doesn't matter, because the wallet
185+
// creation dialog disables the external signer checkbox in both
186+
// cases. The return type could be changed to std::optional<std::vector>
187+
// (or something that also includes error messages) if this distinction
188+
// becomes important.
189+
return {};
190+
#endif // ENABLE_EXTERNAL_SIGNER
181191
}
182-
#endif
183192
int64_t getTotalBytesRecv() override { return m_context->connman ? m_context->connman->GetTotalBytesRecv() : 0; }
184193
int64_t getTotalBytesSent() override { return m_context->connman ? m_context->connman->GetTotalBytesSent() : 0; }
185194
size_t getMempoolSize() override { return m_context->mempool ? m_context->mempool->size() : 0; }

src/qt/createwalletdialog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
3131
// Disable the disable_privkeys_checkbox and external_signer_checkbox when isEncryptWalletChecked is
3232
// set to true, enable it when isEncryptWalletChecked is false.
3333
ui->disable_privkeys_checkbox->setEnabled(!checked);
34+
#ifdef ENABLE_EXTERNAL_SIGNER
3435
ui->external_signer_checkbox->setEnabled(!checked);
35-
36+
#endif
3637
// When the disable_privkeys_checkbox is disabled, uncheck it.
3738
if (!ui->disable_privkeys_checkbox->isEnabled()) {
3839
ui->disable_privkeys_checkbox->setChecked(false);
@@ -112,8 +113,7 @@ CreateWalletDialog::~CreateWalletDialog()
112113
delete ui;
113114
}
114115

115-
#ifdef ENABLE_EXTERNAL_SIGNER
116-
void CreateWalletDialog::setSigners(std::vector<ExternalSigner>& signers)
116+
void CreateWalletDialog::setSigners(const std::vector<ExternalSigner>& signers)
117117
{
118118
if (!signers.empty()) {
119119
ui->external_signer_checkbox->setEnabled(true);
@@ -132,7 +132,6 @@ void CreateWalletDialog::setSigners(std::vector<ExternalSigner>& signers)
132132
ui->external_signer_checkbox->setEnabled(false);
133133
}
134134
}
135-
#endif
136135

137136
QString CreateWalletDialog::walletName() const
138137
{

src/qt/createwalletdialog.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77

88
#include <QDialog>
99

10-
class WalletModel;
11-
12-
#ifdef ENABLE_EXTERNAL_SIGNER
1310
class ExternalSigner;
14-
#endif
11+
class WalletModel;
1512

1613
namespace Ui {
1714
class CreateWalletDialog;
@@ -27,9 +24,7 @@ class CreateWalletDialog : public QDialog
2724
explicit CreateWalletDialog(QWidget* parent);
2825
virtual ~CreateWalletDialog();
2926

30-
#ifdef ENABLE_EXTERNAL_SIGNER
31-
void setSigners(std::vector<ExternalSigner>& signers);
32-
#endif
27+
void setSigners(const std::vector<ExternalSigner>& signers);
3328

3429
QString walletName() const;
3530
bool isEncryptWalletChecked() const;

src/qt/optionsdialog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
9292
ui->thirdPartyTxUrls->setVisible(false);
9393
}
9494

95+
#ifndef ENABLE_EXTERNAL_SIGNER
96+
//: "External signing" means using devices such as hardware wallets.
97+
ui->externalSignerPath->setToolTip(tr("Compiled without external signing support (required for external signing)"));
98+
ui->externalSignerPath->setEnabled(false);
99+
#endif
95100
/* Display elements init */
96101
QDir translations(":translations");
97102

src/qt/receiverequestdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void ReceiveRequestDialog::setInfo(const SendCoinsRecipient &_info)
9090
ui->wallet_content->hide();
9191
}
9292

93-
ui->btnVerify->setVisible(this->model->wallet().hasExternalSigner());
93+
ui->btnVerify->setVisible(model->wallet().hasExternalSigner());
9494

9595
connect(ui->btnVerify, &QPushButton::clicked, [this] {
9696
model->displayAddress(info.address.toStdString());

src/qt/sendcoinsdialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,14 @@ void SendCoinsDialog::setModel(WalletModel *_model)
200200
ui->optInRBF->setCheckState(Qt::Checked);
201201

202202
if (model->wallet().hasExternalSigner()) {
203+
//: "device" usually means a hardware wallet
203204
ui->sendButton->setText(tr("Sign on device"));
204205
if (gArgs.GetArg("-signer", "") != "") {
205206
ui->sendButton->setEnabled(true);
206207
ui->sendButton->setToolTip(tr("Connect your hardware wallet first."));
207208
} else {
208209
ui->sendButton->setEnabled(false);
210+
//: "External signer" means using devices such as hardware wallets.
209211
ui->sendButton->setToolTip(tr("Set external signer script path in Options -> Wallet"));
210212
}
211213
} else if (model->wallet().privateKeysDisabled()) {
@@ -426,11 +428,13 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
426428
return;
427429
}
428430
if (err == TransactionError::EXTERNAL_SIGNER_NOT_FOUND) {
431+
//: "External signer" means using devices such as hardware wallets.
429432
QMessageBox::critical(nullptr, tr("External signer not found"), "External signer not found");
430433
send_failure = true;
431434
return;
432435
}
433436
if (err == TransactionError::EXTERNAL_SIGNER_FAILED) {
437+
//: "External signer" means using devices such as hardware wallets.
434438
QMessageBox::critical(nullptr, tr("External signer failure"), "External signer failure");
435439
send_failure = true;
436440
return;

src/qt/walletcontroller.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <qt/guiutil.h>
1212
#include <qt/walletmodel.h>
1313

14+
#include <external_signer.h>
1415
#include <interfaces/handler.h>
1516
#include <interfaces/node.h>
1617
#include <util/string.h>
@@ -295,15 +296,13 @@ void CreateWalletActivity::create()
295296
{
296297
m_create_wallet_dialog = new CreateWalletDialog(m_parent_widget);
297298

298-
#ifdef ENABLE_EXTERNAL_SIGNER
299299
std::vector<ExternalSigner> signers;
300300
try {
301301
signers = node().externalSigners();
302302
} catch (const std::runtime_error& e) {
303303
QMessageBox::critical(nullptr, tr("Can't list signers"), e.what());
304304
}
305305
m_create_wallet_dialog->setSigners(signers);
306-
#endif
307306

308307
m_create_wallet_dialog->setWindowModality(Qt::ApplicationModal);
309308
m_create_wallet_dialog->show();

src/util/system.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,9 +1243,9 @@ void runCommand(const std::string& strCommand)
12431243
}
12441244
#endif
12451245

1246-
#ifdef ENABLE_EXTERNAL_SIGNER
12471246
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in)
12481247
{
1248+
#ifdef ENABLE_EXTERNAL_SIGNER
12491249
namespace bp = boost::process;
12501250

12511251
UniValue result_json;
@@ -1277,8 +1277,10 @@ UniValue RunCommandParseJSON(const std::string& str_command, const std::string&
12771277
if (!result_json.read(result)) throw std::runtime_error("Unable to parse JSON: " + result);
12781278

12791279
return result_json;
1280-
}
1280+
#else
1281+
throw std::runtime_error("Compiled without external signing support (required for external signing).");
12811282
#endif // ENABLE_EXTERNAL_SIGNER
1283+
}
12821284

12831285
void SetupEnvironment()
12841286
{

src/util/system.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ std::string ShellEscape(const std::string& arg);
102102
#if HAVE_SYSTEM
103103
void runCommand(const std::string& strCommand);
104104
#endif
105-
#ifdef ENABLE_EXTERNAL_SIGNER
106105
/**
107106
* Execute a command which returns JSON, and parse the result.
108107
*
@@ -111,7 +110,6 @@ void runCommand(const std::string& strCommand);
111110
* @return parsed JSON
112111
*/
113112
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in="");
114-
#endif // ENABLE_EXTERNAL_SIGNER
115113

116114
/**
117115
* Most paths passed as configuration arguments are treated as relative to

0 commit comments

Comments
 (0)