@@ -2528,15 +2528,15 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
2528
2528
}
2529
2529
2530
2530
// Send and receive from sockets, accept connections
2531
- threadSocketHandler = std::thread (&util::TraceThread, " net" , std::bind (&CConnman::ThreadSocketHandler, this ) );
2531
+ threadSocketHandler = std::thread (&util::TraceThread, " net" , [ this ] { ThreadSocketHandler (); } );
2532
2532
2533
2533
if (!gArgs .GetBoolArg (" -dnsseed" , DEFAULT_DNSSEED))
2534
2534
LogPrintf (" DNS seeding disabled\n " );
2535
2535
else
2536
- threadDNSAddressSeed = std::thread (&util::TraceThread, " dnsseed" , std::bind (&CConnman::ThreadDNSAddressSeed, this ) );
2536
+ threadDNSAddressSeed = std::thread (&util::TraceThread, " dnsseed" , [ this ] { ThreadDNSAddressSeed (); } );
2537
2537
2538
2538
// Initiate manual connections
2539
- threadOpenAddedConnections = std::thread (&util::TraceThread, " addcon" , std::bind (&CConnman::ThreadOpenAddedConnections, this ) );
2539
+ threadOpenAddedConnections = std::thread (&util::TraceThread, " addcon" , [ this ] { ThreadOpenAddedConnections (); } );
2540
2540
2541
2541
if (connOptions.m_use_addrman_outgoing && !connOptions.m_specified_outgoing .empty ()) {
2542
2542
if (clientInterface) {
@@ -2546,16 +2546,18 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
2546
2546
}
2547
2547
return false ;
2548
2548
}
2549
- if (connOptions.m_use_addrman_outgoing || !connOptions.m_specified_outgoing .empty ())
2550
- threadOpenConnections = std::thread (&util::TraceThread, " opencon" , std::bind (&CConnman::ThreadOpenConnections, this , connOptions.m_specified_outgoing ));
2549
+ if (connOptions.m_use_addrman_outgoing || !connOptions.m_specified_outgoing .empty ()) {
2550
+ threadOpenConnections = std::thread (
2551
+ &util::TraceThread, " opencon" ,
2552
+ [this , connect = connOptions.m_specified_outgoing ] { ThreadOpenConnections (connect); });
2553
+ }
2551
2554
2552
2555
// Process messages
2553
- threadMessageHandler = std::thread (&util::TraceThread, " msghand" , std::bind (&CConnman::ThreadMessageHandler, this ) );
2556
+ threadMessageHandler = std::thread (&util::TraceThread, " msghand" , [ this ] { ThreadMessageHandler (); } );
2554
2557
2555
2558
if (connOptions.m_i2p_accept_incoming && m_i2p_sam_session.get () != nullptr ) {
2556
2559
threadI2PAcceptIncoming =
2557
- std::thread (&util::TraceThread, " i2paccept" ,
2558
- std::function<void ()>(std::bind (&CConnman::ThreadI2PAcceptIncoming, this )));
2560
+ std::thread (&util::TraceThread, " i2paccept" , [this ] { ThreadI2PAcceptIncoming (); });
2559
2561
}
2560
2562
2561
2563
// Dump network addresses
0 commit comments