aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactiontablemodel.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-06-22 23:35:48 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-06-22 23:43:22 +0300
commitd906aaa117e337fc70575beecc0d6da314f57385 (patch)
tree4521cc4ded39f653a8ba333db58887e6135c0fde /src/qt/transactiontablemodel.cpp
parentdbd7a91fdf3ff801fe5e4107e8346d0d6d11a899 (diff)
downloadbitcoin-d906aaa117e337fc70575beecc0d6da314f57385.tar.xz
qt: Fix regression in TransactionTableModel
Since #17993 a crash is possible on exit. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/qt/transactiontablemodel.cpp')
-rw-r--r--src/qt/transactiontablemodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp
index 327a489488..22ba5187bb 100644
--- a/src/qt/transactiontablemodel.cpp
+++ b/src/qt/transactiontablemodel.cpp
@@ -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);