mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
add primordial goo tier "hidden mode" (aka toy feature needs more work doesn't do it correctly all the way)
This commit is contained in:
parent
004a93a841
commit
93deb37c94
5 changed files with 27 additions and 4 deletions
13
NetDb.cpp
13
NetDb.cpp
|
@ -24,7 +24,7 @@ namespace data
|
|||
{
|
||||
NetDb netdb;
|
||||
|
||||
NetDb::NetDb (): m_IsRunning (false), m_Thread (nullptr), m_Reseeder (nullptr), m_Storage("netDb", "r", "routerInfo-", "dat")
|
||||
NetDb::NetDb (): m_IsRunning (false), m_Thread (nullptr), m_Reseeder (nullptr), m_Storage("netDb", "r", "routerInfo-", "dat"), m_HiddenMode(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,11 @@ namespace data
|
|||
ManageLookupResponses ();
|
||||
}
|
||||
lastSave = ts;
|
||||
}
|
||||
}
|
||||
|
||||
// if we're in hidden mode don't publish or explore
|
||||
if (m_HiddenMode) continue;
|
||||
|
||||
if (ts - lastPublish >= 2400) // publish every 40 minutes
|
||||
{
|
||||
Publish ();
|
||||
|
@ -161,6 +165,11 @@ namespace data
|
|||
return false;
|
||||
}
|
||||
|
||||
void NetDb::SetHidden(bool hide) {
|
||||
// TODO: remove reachable addresses from router info
|
||||
m_HiddenMode = hide;
|
||||
}
|
||||
|
||||
bool NetDb::AddRouterInfo (const IdentHash& ident, const uint8_t * buf, int len)
|
||||
{
|
||||
bool updated = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue