diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 3370338bc9..6677d353b2 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -215,19 +216,7 @@ QString ClientModel::blocksDir() const return GUIUtil::PathToQString(gArgs.GetBlocksDirPath()); } -void ClientModel::updateBanlist() -{ - banTableModel->refresh(); -} - // Handlers for core signals -static void BannedListChanged(ClientModel *clientmodel) -{ - qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__); - bool invoked = QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection); - assert(invoked); -} - static void BlockTipChanged(ClientModel* clientmodel, SynchronizationState sync_state, interfaces::BlockTip tip, double verificationProgress, bool fHeader) { if (fHeader) { @@ -277,7 +266,11 @@ void ClientModel::subscribeToCoreSignals() qDebug() << "ClientModel: NotifyAlertChanged"; Q_EMIT alertsChanged(getStatusBarWarnings()); }); - m_handler_banned_list_changed = m_node.handleBannedListChanged(std::bind(BannedListChanged, this)); + m_handler_banned_list_changed = m_node.handleBannedListChanged( + [this]() { + qDebug() << "ClienModel: Requesting update for peer banlist"; + QMetaObject::invokeMethod(banTableModel, [this] { banTableModel->refresh(); }); + }); m_handler_notify_block_tip = m_node.handleNotifyBlockTip(std::bind(BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, false)); m_handler_notify_header_tip = m_node.handleNotifyHeaderTip(std::bind(BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, true)); } diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 84259fa0d3..dacccafb8f 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -120,9 +120,6 @@ Q_SIGNALS: // Show progress dialog e.g. for verifychain void showProgress(const QString &title, int nProgress); - -public Q_SLOTS: - void updateBanlist(); }; #endif // BITCOIN_QT_CLIENTMODEL_H