aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/receivecoinsdialog.cpp3
-rw-r--r--src/qt/walletmodel.cpp5
-rw-r--r--src/qt/walletmodel.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index e458a52856..8c430e0af1 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -99,6 +99,9 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
} else {
ui->useBech32->setCheckState(Qt::Unchecked);
}
+
+ // eventually disable the main receive button if private key operations are disabled
+ ui->receiveButton->setEnabled(!model->privateKeysDisabled());
}
}
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 389acf0a95..cd55b40b71 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -558,6 +558,11 @@ bool WalletModel::isWalletEnabled()
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
}
+bool WalletModel::privateKeysDisabled() const
+{
+ return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
+}
+
QString WalletModel::getWalletName() const
{
return QString::fromStdString(m_wallet->getWalletName());
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 35ededb121..d8935c2fa8 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -197,6 +197,7 @@ public:
bool bumpFee(uint256 hash);
static bool isWalletEnabled();
+ bool privateKeysDisabled() const;
interfaces::Node& node() const { return m_node; }
interfaces::Wallet& wallet() const { return *m_wallet; }