mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user