@ -46,6 +46,7 @@ NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint
m_socket ( new NodeSocket ( _io , * this , ( bi : : udp : : endpoint ) m_node . endpoint ) ) ,
m_socketPointer ( m_socket . get ( ) ) ,
m_timers ( _io )
, m_debug_destroyed ( false )
{
for ( unsigned i = 0 ; i < s_bins ; i + + )
m_state [ i ] . distance = i ;
@ -67,9 +68,13 @@ NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint
NodeTable : : ~ NodeTable ( )
{
DEV_GUARDED ( x_debug )
{
m_debug_destroyed = true ;
m_timers . stop ( ) ;
m_socketPointer - > disconnect ( ) ;
}
}
void NodeTable : : processEvents ( )
{
@ -200,6 +205,10 @@ void NodeTable::doDiscover(NodeId _node, unsigned _round, shared_ptr<set<shared_
{
if ( _ec )
clog ( NodeTableWarn ) < < " Discovery timer canceled! " ;
if ( ! m_debug_destroyed )
DEV_GUARDED ( x_debug )
if ( ! m_debug_destroyed )
doDiscover ( _node , _round + 1 , _tried ) ;
} ) ;
}