mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
qt: Fix regression in TransactionTableModel
Since #17993 a crash is possible on exit. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
parent
dbd7a91fdf
commit
d906aaa117
4 changed files with 12 additions and 3 deletions
|
|
@ -192,7 +192,7 @@ public:
|
|||
interfaces::WalletTxStatus wtx;
|
||||
int numBlocks;
|
||||
int64_t block_time;
|
||||
if (rec->statusUpdateNeeded(cur_block_hash) && wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, block_time)) {
|
||||
if (!cur_block_hash.IsNull() && rec->statusUpdateNeeded(cur_block_hash) && wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, block_time)) {
|
||||
rec->updateStatus(wtx, cur_block_hash, numBlocks, block_time);
|
||||
}
|
||||
return rec;
|
||||
|
|
@ -664,7 +664,7 @@ QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientat
|
|||
QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
TransactionRecord* data = priv->index(walletModel->wallet(), walletModel->clientModel().getBestBlockHash(), row);
|
||||
TransactionRecord* data = priv->index(walletModel->wallet(), walletModel->getLastBlockProcessed(), row);
|
||||
if(data)
|
||||
{
|
||||
return createIndex(row, column, data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue