mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 09:53:47 +01:00
qt, refactor: Drop redundant checks of walletModel
The walletModel member is set in the WalletView constructor now.
This commit is contained in:
parent
404373bc6a
commit
ca0e680bdc
@ -122,14 +122,15 @@ void WalletView::setClientModel(ClientModel *_clientModel)
|
||||
|
||||
overviewPage->setClientModel(_clientModel);
|
||||
sendCoinsPage->setClientModel(_clientModel);
|
||||
if (walletModel) walletModel->setClientModel(_clientModel);
|
||||
walletModel->setClientModel(_clientModel);
|
||||
}
|
||||
|
||||
void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)
|
||||
{
|
||||
// Prevent balloon-spam when initial block download is in progress
|
||||
if (!walletModel || !clientModel || clientModel->node().isInitialBlockDownload())
|
||||
if (!clientModel || clientModel->node().isInitialBlockDownload()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TransactionTableModel *ttm = walletModel->getTransactionTableModel();
|
||||
if (!ttm || ttm->processingQueuedTransactions())
|
||||
@ -204,8 +205,6 @@ void WalletView::showOutOfSyncWarning(bool fShow)
|
||||
|
||||
void WalletView::encryptWallet()
|
||||
{
|
||||
if(!walletModel)
|
||||
return;
|
||||
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
|
||||
dlg.setModel(walletModel);
|
||||
dlg.exec();
|
||||
@ -242,8 +241,6 @@ void WalletView::changePassphrase()
|
||||
|
||||
void WalletView::unlockWallet()
|
||||
{
|
||||
if(!walletModel)
|
||||
return;
|
||||
// Unlock wallet when requested by wallet model
|
||||
if (walletModel->getEncryptionStatus() == WalletModel::Locked)
|
||||
{
|
||||
@ -255,17 +252,11 @@ void WalletView::unlockWallet()
|
||||
|
||||
void WalletView::usedSendingAddresses()
|
||||
{
|
||||
if(!walletModel)
|
||||
return;
|
||||
|
||||
GUIUtil::bringToFront(usedSendingAddressesPage);
|
||||
}
|
||||
|
||||
void WalletView::usedReceivingAddresses()
|
||||
{
|
||||
if(!walletModel)
|
||||
return;
|
||||
|
||||
GUIUtil::bringToFront(usedReceivingAddressesPage);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user