Skip to content

Commit

Permalink
coderabbit comments applied
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Nov 11, 2024
1 parent 3ae2e27 commit 24e2761
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
7 changes: 3 additions & 4 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint256, std::pair<int, bool>> current = *itr;
priv->cachedUpdatedTx.erase(--priv->cachedUpdatedTx.end());
itr++;
std::pair<uint256, std::pair<int, bool>> 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())
Expand Down

0 comments on commit 24e2761

Please sign in to comment.