Fix some uninitialized variables in dash-qt (#1324)

* Fix uninitialized variables in WalletModel

* Fix uninitialized variable on overviewpage startup
This commit is contained in:
Tim Flynn 2017-02-09 00:29:00 -05:00 committed by UdjinM6
parent 56971f8da1
commit fecb3e4fe6
2 changed files with 13 additions and 6 deletions

View File

@ -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()

View File

@ -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;