diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 2c9458b295..e9643758ff 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -161,7 +161,7 @@ QDateTime ClientModel::getLastBlockDate() const TRY_LOCK(cs_main,lock); if (!lock) - cachedLastBlockDate; + return cachedLastBlockDate; if (chainActive.Tip()) { cachedLastBlockDate = QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime()); diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index d15ae81e62..f1d3157db7 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -295,11 +295,10 @@ void TransactionTableModel::updateTransaction(const QString &hash, int status, b updated.SetHex(hash.toStdString()); priv->cachedUpdatedTx.push_back(std::make_pair(updated, std::make_pair(status, showTransaction))); size_t currentSize = priv->cachedUpdatedTx.size(); - for (auto itr = priv->cachedUpdatedTx.rbegin(); itr!= priv->cachedUpdatedTx.rend();) + while (!priv->cachedUpdatedTx.empty()) { - std::pair> current = *itr; - priv->cachedUpdatedTx.erase(--priv->cachedUpdatedTx.end()); - itr++; + std::pair> current = priv->cachedUpdatedTx.back(); + priv->cachedUpdatedTx.pop_back(); priv->updateWallet(current.first, current.second.first, current.second.second); // this thread was not able to perform the update, stop and do it next time if (currentSize == priv->cachedUpdatedTx.size())