Browse Source

[Qt] make sure transaction table entry gets updated after bump

0.15
Jonas Schnelli 8 years ago
parent
commit
6d7104c994
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D
  1. 4
      src/qt/transactionrecord.cpp
  2. 2
      src/qt/transactionrecord.h
  3. 4
      src/qt/transactiontablemodel.cpp

4
src/qt/transactionrecord.cpp

@ -246,13 +246,13 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) @@ -246,13 +246,13 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
status.status = TransactionStatus::Confirmed;
}
}
status.needsUpdate = false;
}
bool TransactionRecord::statusUpdateNeeded()
{
AssertLockHeld(cs_main);
return status.cur_num_blocks != chainActive.Height();
return status.cur_num_blocks != chainActive.Height() || status.needsUpdate;
}
QString TransactionRecord::getTxID() const

2
src/qt/transactionrecord.h

@ -61,6 +61,8 @@ public: @@ -61,6 +61,8 @@ public:
/** Current number of blocks (to know whether cached status is still valid) */
int cur_num_blocks;
bool needsUpdate;
};
/** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has

4
src/qt/transactiontablemodel.cpp

@ -168,6 +168,10 @@ public: @@ -168,6 +168,10 @@ public:
case CT_UPDATED:
// Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for
// visible transactions.
for (int i = lowerIndex; i < upperIndex; i++) {
TransactionRecord *rec = &cachedWallet[i];
rec->status.needsUpdate = true;
}
break;
}
}

Loading…
Cancel
Save