diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 00b7952ca4..68f2139057 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -18,6 +18,7 @@ #include #include // for -dbcache defaults #include +#include #include // For DEFAULT_SCRIPTCHECK_THREADS #include // For DEFAULT_SPEND_ZEROCONF_CHANGE @@ -640,6 +641,11 @@ bool OptionsModel::isRestartRequired() const return settings.value("fRestartRequired", false).toBool(); } +bool OptionsModel::hasSigner() +{ + return gArgs.GetArg("-signer", "") != ""; +} + void OptionsModel::checkAndMigrate() { // Migration of default values diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index e36fbc5b31..ccab9c19ad 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -98,6 +98,9 @@ public: bool getEnablePSBTControls() const { return m_enable_psbt_controls; } const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; } + /** Whether -signer was set or not */ + bool hasSigner(); + /* Explicit setters */ void SetPruneTargetGB(int prune_target_gb); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 1604cad503..4a50416fc6 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -203,7 +203,7 @@ void SendCoinsDialog::setModel(WalletModel *_model) if (model->wallet().hasExternalSigner()) { //: "device" usually means a hardware wallet. ui->sendButton->setText(tr("Sign on device")); - if (gArgs.GetArg("-signer", "") != "") { + if (model->getOptionsModel()->hasSigner()) { ui->sendButton->setEnabled(true); ui->sendButton->setToolTip(tr("Connect your hardware wallet first.")); } else { diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp index a581cd53da..69208c19dc 100644 --- a/src/wallet/dump.cpp +++ b/src/wallet/dump.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp index 31435a69ba..4d82e0a41f 100644 --- a/src/wallet/rpc/util.cpp +++ b/src/wallet/rpc/util.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e8fe1627c9..b6d4f0ac37 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 5ffac182a8..6ec95220d6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #include #include