@@ -184,34 +184,39 @@ void ClientModel::updateBanlist()
184184static void ShowProgress (ClientModel *clientmodel, const std::string &title, int nProgress)
185185{
186186 // emits signal "showProgress"
187- QMetaObject::invokeMethod (clientmodel, " showProgress" , Qt::QueuedConnection,
187+ bool invoked = QMetaObject::invokeMethod (clientmodel, " showProgress" , Qt::QueuedConnection,
188188 Q_ARG (QString, QString::fromStdString (title)),
189189 Q_ARG (int , nProgress));
190+ assert (invoked);
190191}
191192
192193static void NotifyNumConnectionsChanged (ClientModel *clientmodel, int newNumConnections)
193194{
194195 // Too noisy: qDebug() << "NotifyNumConnectionsChanged: " + QString::number(newNumConnections);
195- QMetaObject::invokeMethod (clientmodel, " updateNumConnections" , Qt::QueuedConnection,
196+ bool invoked = QMetaObject::invokeMethod (clientmodel, " updateNumConnections" , Qt::QueuedConnection,
196197 Q_ARG (int , newNumConnections));
198+ assert (invoked);
197199}
198200
199201static void NotifyNetworkActiveChanged (ClientModel *clientmodel, bool networkActive)
200202{
201- QMetaObject::invokeMethod (clientmodel, " updateNetworkActive" , Qt::QueuedConnection,
203+ bool invoked = QMetaObject::invokeMethod (clientmodel, " updateNetworkActive" , Qt::QueuedConnection,
202204 Q_ARG (bool , networkActive));
205+ assert (invoked);
203206}
204207
205208static void NotifyAlertChanged (ClientModel *clientmodel)
206209{
207210 qDebug () << " NotifyAlertChanged" ;
208- QMetaObject::invokeMethod (clientmodel, " updateAlert" , Qt::QueuedConnection);
211+ bool invoked = QMetaObject::invokeMethod (clientmodel, " updateAlert" , Qt::QueuedConnection);
212+ assert (invoked);
209213}
210214
211215static void BannedListChanged (ClientModel *clientmodel)
212216{
213217 qDebug () << QString (" %1: Requesting update for peer banlist" ).arg (__func__);
214- QMetaObject::invokeMethod (clientmodel, " updateBanlist" , Qt::QueuedConnection);
218+ bool invoked = QMetaObject::invokeMethod (clientmodel, " updateBanlist" , Qt::QueuedConnection);
219+ assert (invoked);
215220}
216221
217222static void BlockTipChanged (ClientModel *clientmodel, bool initialSync, int height, int64_t blockTime, double verificationProgress, bool fHeader )
@@ -233,11 +238,12 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig
233238 // if we are in-sync or if we notify a header update, update the UI regardless of last update time
234239 if (fHeader || !initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
235240 // pass an async signal to the UI thread
236- QMetaObject::invokeMethod (clientmodel, " numBlocksChanged" , Qt::QueuedConnection,
241+ bool invoked = QMetaObject::invokeMethod (clientmodel, " numBlocksChanged" , Qt::QueuedConnection,
237242 Q_ARG (int , height),
238243 Q_ARG (QDateTime, QDateTime::fromTime_t (blockTime)),
239244 Q_ARG (double , verificationProgress),
240245 Q_ARG (bool , fHeader ));
246+ assert (invoked);
241247 nLastUpdateNotification = now;
242248 }
243249}
0 commit comments