diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-03-27 19:31:37 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-05 16:47:08 +0300 |
commit | bc00e13bc800863641b3e1e64732a38418d3022f (patch) | |
tree | e35f69bbbc94af928001bc4ba26f9e245346ed92 /src/qt | |
parent | eb6156ba1b4c303eb597e3fc4a9e42ce45e6e78d (diff) |
qt: Handle exceptions in WalletModel::pollBalanceChanged slot
Actually, the private QTimer::timeout signal has one
QTimer::QPrivateSignal parameter.
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/walletmodel.cpp | 5 | ||||
-rw-r--r-- | src/qt/walletmodel.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 02254da3ce..c6dd0c2ad6 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -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); } diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 9a3c3f2f66..4ca8643444 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -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(); |