0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

qt: Handle exceptions in WalletModel::pollBalanceChanged slot

Actually, the private QTimer::timeout signal has one
QTimer::QPrivateSignal parameter.
This commit is contained in:
Hennadii Stepanov 2021-03-27 19:31:37 +02:00
parent eb6156ba1b
commit bc00e13bc8
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 6 additions and 1 deletions

View file

@ -65,7 +65,10 @@ WalletModel::~WalletModel()
void WalletModel::startPollBalance()
{
// This timer will be fired repeatedly to update the balance
connect(timer, &QTimer::timeout, this, &WalletModel::pollBalanceChanged);
// Since the QTimer::timeout is a private signal, it cannot be used
// in the GUIUtil::ExceptionSafeConnect directly.
connect(timer, &QTimer::timeout, this, &WalletModel::timerTimeout);
GUIUtil::ExceptionSafeConnect(this, &WalletModel::timerTimeout, this, &WalletModel::pollBalanceChanged);
timer->start(MODEL_UPDATE_DELAY);
}

View file

@ -223,6 +223,8 @@ Q_SIGNALS:
// Notify that there are now keys in the keypool
void canGetAddressesChanged();
void timerTimeout();
public Q_SLOTS:
/* Starts a timer to periodically update the balance */
void startPollBalance();