mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
refactor: Get rid of Wallet::IsWalletFlagSet method
Replace by privateKeysDisabled method to avoid need for GUI to reference internal wallet flags. Also remove adjacent WalletModel canGetAddresses wrapper that serves no purpose and make Wallet::canGetAddresses non-const so it can be implemented by IPC classes in #10102.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <ui_interface.h>
|
||||
#include <util/system.h> // for GetBoolArg
|
||||
#include <wallet/coincontrol.h>
|
||||
#include <wallet/wallet.h>
|
||||
#include <wallet/wallet.h> // for CRecipient
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -184,7 +184,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
||||
std::string strFailReason;
|
||||
|
||||
auto& newTx = transaction.getWtx();
|
||||
newTx = m_wallet->createTransaction(vecSend, coinControl, !privateKeysDisabled() /* sign */, nChangePosRet, nFeeRequired, strFailReason);
|
||||
newTx = m_wallet->createTransaction(vecSend, coinControl, !wallet().privateKeysDisabled() /* sign */, nChangePosRet, nFeeRequired, strFailReason);
|
||||
transaction.setTransactionFee(nFeeRequired);
|
||||
if (fSubtractFeeFromAmount && newTx)
|
||||
transaction.reassignAmounts(nChangePosRet);
|
||||
@@ -488,7 +488,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool create_psbt = privateKeysDisabled();
|
||||
const bool create_psbt = m_wallet->privateKeysDisabled();
|
||||
|
||||
// allow a user based fee verification
|
||||
QString questionString = create_psbt ? tr("Do you want to draft a transaction with fee increase?") : tr("Do you want to increase the fee?");
|
||||
@@ -558,16 +558,6 @@ bool WalletModel::isWalletEnabled()
|
||||
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
|
||||
}
|
||||
|
||||
bool WalletModel::privateKeysDisabled() const
|
||||
{
|
||||
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
|
||||
}
|
||||
|
||||
bool WalletModel::canGetAddresses() const
|
||||
{
|
||||
return m_wallet->canGetAddresses();
|
||||
}
|
||||
|
||||
QString WalletModel::getWalletName() const
|
||||
{
|
||||
return QString::fromStdString(m_wallet->getWalletName());
|
||||
|
||||
Reference in New Issue
Block a user