From ebb0758d14311496e1b1f676c74d5953663e8660 Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Fri, 18 Jan 2019 07:40:05 -0800 Subject: [PATCH] Fix issue #9683 "gui, wallet: random abort (segmentation fault) running master/HEAD". Patch taken from @ryanofsky's comment https://github.com/bitcoin/bitcoin/issues/9683#issuecomment-448035913. --- src/qt/transactionview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index eb6437eb31ba4e..6eddc1c4df805c 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -218,6 +218,7 @@ void TransactionView::setModel(WalletModel *_model) { transactionProxyModel = new TransactionFilterProxy(this); transactionProxyModel->setSourceModel(_model->getTransactionTableModel()); + transactionProxyModel->setSortRole(Qt::EditRole); transactionProxyModel->setDynamicSortFilter(true); transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); @@ -229,8 +230,8 @@ void TransactionView::setModel(WalletModel *_model) transactionView->setAlternatingRowColors(true); transactionView->setSelectionBehavior(QAbstractItemView::SelectRows); transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection); + transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder); transactionView->setSortingEnabled(true); - transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder); transactionView->verticalHeader()->hide(); transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);