1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 04:04:16 +00:00

Add reseed.threshold option

This commit is contained in:
Darknet Villain 2017-02-02 15:40:57 -05:00
parent a03bf89190
commit 33310732a6
2 changed files with 4 additions and 1 deletions

View File

@ -165,6 +165,7 @@ namespace config {
options_description reseed("Reseed options"); options_description reseed("Reseed options");
reseed.add_options() reseed.add_options()
("reseed.verify", value<bool>()->default_value(false), "Verify .su3 signature") ("reseed.verify", value<bool>()->default_value(false), "Verify .su3 signature")
("reseed.threshold", value<uint16_t>()->default_value(25), "Minimum number of known routers before requesting reseed")
("reseed.floodfill", value<std::string>()->default_value(""), "Path to router info of floodfill to reseed from") ("reseed.floodfill", value<std::string>()->default_value(""), "Path to router info of floodfill to reseed from")
("reseed.file", value<std::string>()->default_value(""), "Path to local .su3 file or HTTPS URL to reseed from") ("reseed.file", value<std::string>()->default_value(""), "Path to local .su3 file or HTTPS URL to reseed from")
("reseed.zipfile", value<std::string>()->default_value(""), "Path to local .zip file to reseed from") ("reseed.zipfile", value<std::string>()->default_value(""), "Path to local .zip file to reseed from")

View File

@ -41,7 +41,9 @@ namespace data
InitProfilesStorage (); InitProfilesStorage ();
m_Families.LoadCertificates (); m_Families.LoadCertificates ();
Load (); Load ();
if (m_RouterInfos.size () < 25) // reseed if # of router less than 50
uint16_t threshold; i2p::config::GetOption("reseed.threshold", threshold);
if (m_RouterInfos.size () < threshold) // reseed if # of router less than threshold
Reseed (); Reseed ();
m_IsRunning = true; m_IsRunning = true;