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

This commit is contained in:
Jonas Schnelli 2017-05-24 17:09:01 +02:00
parent 32325a3f58
commit 6d7104c994
No known key found for this signature in database
GPG key ID: 1EB776BB03C7922D
3 changed files with 8 additions and 2 deletions

View file

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

View file

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

View file

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