Skip to content

Commit ca0e680

Browse files
committed
qt, refactor: Drop redundant checks of walletModel
The walletModel member is set in the WalletView constructor now.
1 parent 404373b commit ca0e680

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/qt/walletview.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,15 @@ void WalletView::setClientModel(ClientModel *_clientModel)
122122

123123
overviewPage->setClientModel(_clientModel);
124124
sendCoinsPage->setClientModel(_clientModel);
125-
if (walletModel) walletModel->setClientModel(_clientModel);
125+
walletModel->setClientModel(_clientModel);
126126
}
127127

128128
void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)
129129
{
130130
// Prevent balloon-spam when initial block download is in progress
131-
if (!walletModel || !clientModel || clientModel->node().isInitialBlockDownload())
131+
if (!clientModel || clientModel->node().isInitialBlockDownload()) {
132132
return;
133+
}
133134

134135
TransactionTableModel *ttm = walletModel->getTransactionTableModel();
135136
if (!ttm || ttm->processingQueuedTransactions())
@@ -204,8 +205,6 @@ void WalletView::showOutOfSyncWarning(bool fShow)
204205

205206
void WalletView::encryptWallet()
206207
{
207-
if(!walletModel)
208-
return;
209208
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
210209
dlg.setModel(walletModel);
211210
dlg.exec();
@@ -242,8 +241,6 @@ void WalletView::changePassphrase()
242241

243242
void WalletView::unlockWallet()
244243
{
245-
if(!walletModel)
246-
return;
247244
// Unlock wallet when requested by wallet model
248245
if (walletModel->getEncryptionStatus() == WalletModel::Locked)
249246
{
@@ -255,17 +252,11 @@ void WalletView::unlockWallet()
255252

256253
void WalletView::usedSendingAddresses()
257254
{
258-
if(!walletModel)
259-
return;
260-
261255
GUIUtil::bringToFront(usedSendingAddressesPage);
262256
}
263257

264258
void WalletView::usedReceivingAddresses()
265259
{
266-
if(!walletModel)
267-
return;
268-
269260
GUIUtil::bringToFront(usedReceivingAddressesPage);
270261
}
271262

0 commit comments

Comments
 (0)