Defer heavy UI model loading for faster startup

- Address table and transaction table now load asynchronously via
  QTimer::singleShot after the event loop starts instead of blocking
  the constructor
- MessageModel (secure messaging) lazy-loaded 1s after wallet init
  or on-demand when navigating to message page
- Splash screen stays visible until window.show() completes
- Guard updateConfirmations() against empty transaction table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 00:48:05 -07:00
parent e133e97f3b
commit 4266c8f146
7 changed files with 38 additions and 9 deletions
+10 -2
View File
@@ -225,8 +225,7 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
cachedNumBlocks(0)
{
columns << QString() << tr("Date") << tr("Type") << tr("Address") << tr("Amount");
priv->refreshWallet();
QTimer::singleShot(0, this, SLOT(refreshWallet()));
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(updateConfirmations()));
@@ -248,8 +247,17 @@ void TransactionTableModel::updateTransaction(const QString &hash, int status)
priv->updateWallet(updated, status);
}
void TransactionTableModel::refreshWallet()
{
priv->refreshWallet();
reset();
}
void TransactionTableModel::updateConfirmations()
{
if(!priv->size())
return;
if(nBestHeight != cachedNumBlocks)
{
cachedNumBlocks = nBestHeight;