|
|
@ -240,11 +240,10 @@ namespace data |
|
|
|
m_HiddenMode = hide; |
|
|
|
m_HiddenMode = hide; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool NetDb::AddRouterInfo (const uint8_t * buf, int len) |
|
|
|
std::shared_ptr<const RouterInfo> NetDb::AddRouterInfo (const uint8_t * buf, int len) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool updated; |
|
|
|
bool updated; |
|
|
|
AddRouterInfo (buf, len, updated); |
|
|
|
return AddRouterInfo (buf, len, updated); |
|
|
|
return updated; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<const RouterInfo> NetDb::AddRouterInfo (const uint8_t * buf, int len, bool& updated) |
|
|
|
std::shared_ptr<const RouterInfo> NetDb::AddRouterInfo (const uint8_t * buf, int len, bool& updated) |
|
|
@ -436,12 +435,15 @@ namespace data |
|
|
|
|
|
|
|
|
|
|
|
// try reseeding from floodfill first if specified
|
|
|
|
// try reseeding from floodfill first if specified
|
|
|
|
std::string riPath; |
|
|
|
std::string riPath; |
|
|
|
if(i2p::config::GetOption("reseed.floodfill", riPath)) { |
|
|
|
if(i2p::config::GetOption("reseed.floodfill", riPath)) |
|
|
|
|
|
|
|
{ |
|
|
|
auto ri = std::make_shared<RouterInfo>(riPath); |
|
|
|
auto ri = std::make_shared<RouterInfo>(riPath); |
|
|
|
if (ri->IsFloodfill()) { |
|
|
|
if (ri->IsFloodfill()) |
|
|
|
|
|
|
|
{ |
|
|
|
const uint8_t * riData = ri->GetBuffer(); |
|
|
|
const uint8_t * riData = ri->GetBuffer(); |
|
|
|
int riLen = ri->GetBufferLen(); |
|
|
|
int riLen = ri->GetBufferLen(); |
|
|
|
if(!i2p::data::netdb.AddRouterInfo(riData, riLen)) { |
|
|
|
if (!i2p::data::netdb.AddRouterInfo(riData, riLen)) |
|
|
|
|
|
|
|
{ |
|
|
|
// bad router info
|
|
|
|
// bad router info
|
|
|
|
LogPrint(eLogError, "NetDb: Bad router info"); |
|
|
|
LogPrint(eLogError, "NetDb: Bad router info"); |
|
|
|
return; |
|
|
|
return; |
|
|
|