From fecb3e4fe641c0491e6b6bb9bf8a0c4a9603396c Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Thu, 9 Feb 2017 00:29:00 -0500 Subject: [PATCH] Fix some uninitialized variables in dash-qt (#1324) * Fix uninitialized variables in WalletModel * Fix uninitialized variable on overviewpage startup --- src/qt/overviewpage.cpp | 7 +++---- src/qt/walletmodel.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index def9a570b..ee4c47fd4 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -271,6 +271,8 @@ void OverviewPage::setWalletModel(WalletModel *model) this->walletModel = model; if(model && model->getOptionsModel()) { + // update the display unit, to not use the default ("DASH") + updateDisplayUnit(); // Keep up to date with wallet setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getAnonymizedBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); @@ -290,9 +292,6 @@ void OverviewPage::setWalletModel(WalletModel *model) updateWatchOnlyLabels(model->haveWatchOnly()); connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool))); } - - // update the display unit, to not use the default ("DASH") - updateDisplayUnit(); } void OverviewPage::updateDisplayUnit() @@ -671,4 +670,4 @@ void OverviewPage::DisablePrivateSendCompletely() { ui->labelPrivateSendEnabled->setText("(" + tr("Disabled") + ")"); } fEnablePrivateSend = false; -} \ No newline at end of file +} diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 23105963c..d7fc3601e 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -36,9 +36,17 @@ WalletModel::WalletModel(const PlatformStyle *platformStyle, CWallet *wallet, Op QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), transactionTableModel(0), recentRequestsTableModel(0), - cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0), + cachedBalance(0), + cachedUnconfirmedBalance(0), + cachedImmatureBalance(0), + cachedAnonymizedBalance(0), + cachedWatchOnlyBalance(0), + cachedWatchUnconfBalance(0), + cachedWatchImmatureBalance(0), cachedEncryptionStatus(Unencrypted), - cachedNumBlocks(0) + cachedNumBlocks(0), + cachedTxLocks(0), + cachedPrivateSendRounds(0) { fHaveWatchOnly = wallet->HaveWatchOnly(); fForceCheckBalanceChanged = false;