From ca0e680bdcaa816c53355777d788a4c8478bb117 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 7 Aug 2021 18:13:27 +0300 Subject: [PATCH] qt, refactor: Drop redundant checks of walletModel The walletModel member is set in the WalletView constructor now. --- src/qt/walletview.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 9a0042024d1..309806a1c40 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -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); }