mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-20 04:36:08 +01:00
qt: Move transaction notification to transaction table model
Move transaction new/update notification to TransactionTableModel. This moves the concerns to where they're actually handled. No need to bounce this through wallet model. - Do wallet transaction preprocessing on signal handler side; avoids locking cs_main/cs_wallet on notification in GUI thread (except for new transactions)
This commit is contained in:
@@ -137,10 +137,12 @@ void WalletView::setWalletModel(WalletModel *walletModel)
|
||||
void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)
|
||||
{
|
||||
// Prevent balloon-spam when initial block download is in progress
|
||||
if (!walletModel || walletModel->processingQueuedTransactions() || !clientModel || clientModel->inInitialBlockDownload())
|
||||
if (!walletModel || !clientModel || clientModel->inInitialBlockDownload())
|
||||
return;
|
||||
|
||||
TransactionTableModel *ttm = walletModel->getTransactionTableModel();
|
||||
if (!ttm || ttm->processingQueuedTransactions())
|
||||
return;
|
||||
|
||||
QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString();
|
||||
qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong();
|
||||
|
||||
Reference in New Issue
Block a user