|
24 | 24 | #include <functional>
|
25 | 25 |
|
26 | 26 | #include <QDebug>
|
| 27 | +#include <QMetaObject> |
27 | 28 | #include <QThread>
|
28 | 29 | #include <QTimer>
|
29 | 30 |
|
@@ -215,19 +216,7 @@ QString ClientModel::blocksDir() const
|
215 | 216 | return GUIUtil::PathToQString(gArgs.GetBlocksDirPath());
|
216 | 217 | }
|
217 | 218 |
|
218 |
| -void ClientModel::updateBanlist() |
219 |
| -{ |
220 |
| - banTableModel->refresh(); |
221 |
| -} |
222 |
| - |
223 | 219 | // Handlers for core signals
|
224 |
| -static void BannedListChanged(ClientModel *clientmodel) |
225 |
| -{ |
226 |
| - qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__); |
227 |
| - bool invoked = QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection); |
228 |
| - assert(invoked); |
229 |
| -} |
230 |
| - |
231 | 220 | static void BlockTipChanged(ClientModel* clientmodel, SynchronizationState sync_state, interfaces::BlockTip tip, double verificationProgress, bool fHeader)
|
232 | 221 | {
|
233 | 222 | if (fHeader) {
|
@@ -277,7 +266,11 @@ void ClientModel::subscribeToCoreSignals()
|
277 | 266 | qDebug() << "ClientModel: NotifyAlertChanged";
|
278 | 267 | Q_EMIT alertsChanged(getStatusBarWarnings());
|
279 | 268 | });
|
280 |
| - m_handler_banned_list_changed = m_node.handleBannedListChanged(std::bind(BannedListChanged, this)); |
| 269 | + m_handler_banned_list_changed = m_node.handleBannedListChanged( |
| 270 | + [this]() { |
| 271 | + qDebug() << "ClienModel: Requesting update for peer banlist"; |
| 272 | + QMetaObject::invokeMethod(banTableModel, [this] { banTableModel->refresh(); }); |
| 273 | + }); |
281 | 274 | m_handler_notify_block_tip = m_node.handleNotifyBlockTip(std::bind(BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, false));
|
282 | 275 | m_handler_notify_header_tip = m_node.handleNotifyHeaderTip(std::bind(BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, true));
|
283 | 276 | }
|
|
0 commit comments