[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.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

View File

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

View File

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