mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-17 16:14:44 +01:00
[Qt] Disable creating receive addresses when private keys are disabled
This commit is contained in:
@@ -426,6 +426,7 @@ public:
|
|||||||
}
|
}
|
||||||
unsigned int getConfirmTarget() override { return m_wallet.m_confirm_target; }
|
unsigned int getConfirmTarget() override { return m_wallet.m_confirm_target; }
|
||||||
bool hdEnabled() override { return m_wallet.IsHDEnabled(); }
|
bool hdEnabled() override { return m_wallet.IsHDEnabled(); }
|
||||||
|
bool IsWalletFlagSet(uint64_t flag) override { return m_wallet.IsWalletFlagSet(flag); }
|
||||||
OutputType getDefaultAddressType() override { return m_wallet.m_default_address_type; }
|
OutputType getDefaultAddressType() override { return m_wallet.m_default_address_type; }
|
||||||
OutputType getDefaultChangeType() override { return m_wallet.m_default_change_type; }
|
OutputType getDefaultChangeType() override { return m_wallet.m_default_change_type; }
|
||||||
std::unique_ptr<Handler> handleUnload(UnloadFn fn) override
|
std::unique_ptr<Handler> handleUnload(UnloadFn fn) override
|
||||||
|
|||||||
@@ -236,6 +236,9 @@ public:
|
|||||||
// Return whether HD enabled.
|
// Return whether HD enabled.
|
||||||
virtual bool hdEnabled() = 0;
|
virtual bool hdEnabled() = 0;
|
||||||
|
|
||||||
|
// check if a certain wallet flag is set.
|
||||||
|
virtual bool IsWalletFlagSet(uint64_t flag) = 0;
|
||||||
|
|
||||||
// Get default address type.
|
// Get default address type.
|
||||||
virtual OutputType getDefaultAddressType() = 0;
|
virtual OutputType getDefaultAddressType() = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
|||||||
} else {
|
} else {
|
||||||
ui->useBech32->setCheckState(Qt::Unchecked);
|
ui->useBech32->setCheckState(Qt::Unchecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eventually disable the main receive button if private key operations are disabled
|
||||||
|
ui->receiveButton->setEnabled(!model->privateKeysDisabled());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -558,6 +558,11 @@ bool WalletModel::isWalletEnabled()
|
|||||||
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
|
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WalletModel::privateKeysDisabled() const
|
||||||
|
{
|
||||||
|
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
|
||||||
|
}
|
||||||
|
|
||||||
QString WalletModel::getWalletName() const
|
QString WalletModel::getWalletName() const
|
||||||
{
|
{
|
||||||
return QString::fromStdString(m_wallet->getWalletName());
|
return QString::fromStdString(m_wallet->getWalletName());
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ public:
|
|||||||
bool bumpFee(uint256 hash);
|
bool bumpFee(uint256 hash);
|
||||||
|
|
||||||
static bool isWalletEnabled();
|
static bool isWalletEnabled();
|
||||||
|
bool privateKeysDisabled() const;
|
||||||
|
|
||||||
interfaces::Node& node() const { return m_node; }
|
interfaces::Node& node() const { return m_node; }
|
||||||
interfaces::Wallet& wallet() const { return *m_wallet; }
|
interfaces::Wallet& wallet() const { return *m_wallet; }
|
||||||
|
|||||||
Reference in New Issue
Block a user