Browse Source

don't manage netdb is transports are not running

pull/1941/merge
orignal 8 months ago
parent
commit
cdfdfc9e24
  1. 3
      libi2pd/NetDb.cpp
  2. 1
      libi2pd/Transports.h

3
libi2pd/NetDb.cpp

@ -146,7 +146,8 @@ namespace data @@ -146,7 +146,8 @@ namespace data
}
}
if (!m_IsRunning) break;
if (!i2p::transport::transports.IsOnline ()) continue; // don't manage netdb when offline
if (!i2p::transport::transports.IsOnline () || !i2p::transport::transports.IsRunning ())
continue; // don't manage netdb when offline or transports are not running
uint64_t mts = i2p::util::GetMonotonicMilliseconds ();
if (mts >= lastManageRequest + MANAGE_REQUESTS_INTERVAL*1000)

1
libi2pd/Transports.h

@ -134,6 +134,7 @@ namespace transport @@ -134,6 +134,7 @@ namespace transport
void Start (bool enableNTCP2=true, bool enableSSU2=true);
void Stop ();
bool IsRunning () const { return m_IsRunning; }
bool IsBoundSSU2() const { return m_SSU2Server != nullptr; }
bool IsBoundNTCP2() const { return m_NTCP2Server != nullptr; }

Loading…
Cancel
Save