|
14 | 14 | #include "chainparams.h" |
15 | 15 | #include "checkpoints.h" |
16 | 16 | #include "clientversion.h" |
17 | | -#include "masternode-sync.h" |
| 17 | +#include "interfaces/handler.h" |
18 | 18 | #include "masternodeman.h" |
19 | 19 | #include "net.h" |
20 | 20 | #include "netbase.h" |
@@ -310,21 +310,21 @@ static void BannedListChanged(ClientModel *clientmodel) |
310 | 310 | void ClientModel::subscribeToCoreSignals() |
311 | 311 | { |
312 | 312 | // Connect signals to client |
313 | | - uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, boost::placeholders::_1, boost::placeholders::_2)); |
314 | | - uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, boost::placeholders::_1)); |
315 | | - uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this)); |
316 | | - uiInterface.BannedListChanged.connect(boost::bind(BannedListChanged, this)); |
317 | | - uiInterface.NotifyBlockTip.connect(boost::bind(BlockTipChanged, this, boost::placeholders::_1, boost::placeholders::_2)); |
| 313 | + m_handler_show_progress = interfaces::MakeHandler(uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, boost::placeholders::_1, boost::placeholders::_2))); |
| 314 | + m_handler_notify_num_connections_changed = interfaces::MakeHandler(uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, boost::placeholders::_1))); |
| 315 | + m_handler_notify_alert_changed = interfaces::MakeHandler(uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this))); |
| 316 | + m_handler_banned_list_changed = interfaces::MakeHandler(uiInterface.BannedListChanged.connect(boost::bind(BannedListChanged, this))); |
| 317 | + m_handler_notify_block_tip = interfaces::MakeHandler(uiInterface.NotifyBlockTip.connect(boost::bind(BlockTipChanged, this, boost::placeholders::_1, boost::placeholders::_2))); |
318 | 318 | } |
319 | 319 |
|
320 | 320 | void ClientModel::unsubscribeFromCoreSignals() |
321 | 321 | { |
322 | 322 | // Disconnect signals from client |
323 | | - uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, boost::placeholders::_1, boost::placeholders::_2)); |
324 | | - uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, boost::placeholders::_1)); |
325 | | - uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this)); |
326 | | - uiInterface.BannedListChanged.disconnect(boost::bind(BannedListChanged, this)); |
327 | | - uiInterface.NotifyBlockTip.disconnect(boost::bind(BlockTipChanged, this, boost::placeholders::_1, boost::placeholders::_2)); |
| 323 | + m_handler_show_progress->disconnect(); |
| 324 | + m_handler_notify_num_connections_changed->disconnect(); |
| 325 | + m_handler_notify_alert_changed->disconnect(); |
| 326 | + m_handler_banned_list_changed->disconnect(); |
| 327 | + m_handler_notify_block_tip->disconnect(); |
328 | 328 | } |
329 | 329 |
|
330 | 330 | bool ClientModel::getTorInfo(std::string& ip_port) const |
|
0 commit comments