mirror of https://github.com/oxen-io/lokinet
This commit is contained in:
parent
c8553736a5
commit
a3474127c9
|
@ -344,8 +344,9 @@ namespace llarp
|
|||
void
|
||||
NodeDB::fetch_initial()
|
||||
{
|
||||
if (known_rids.empty())
|
||||
if (known_rcs.empty())
|
||||
{
|
||||
log::critical(logcat, "No RC's held locally... BOOTSTRAP TIME");
|
||||
fallback_to_bootstrap();
|
||||
}
|
||||
else
|
||||
|
@ -606,6 +607,14 @@ namespace llarp
|
|||
{
|
||||
_router.last_rc_fetch = llarp::time_point_now();
|
||||
|
||||
if (_router.is_service_node())
|
||||
{
|
||||
_needs_rebootstrap = false;
|
||||
fail_sources.clear();
|
||||
fetch_failures = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (initial)
|
||||
fetch_rids(initial);
|
||||
}
|
||||
|
@ -620,7 +629,10 @@ namespace llarp
|
|||
_needs_rebootstrap = false;
|
||||
|
||||
if (initial)
|
||||
{
|
||||
_needs_initial_fetch = false;
|
||||
_initial_completed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -756,9 +768,6 @@ namespace llarp
|
|||
registered_routers.insert(greylist.begin(), greylist.end());
|
||||
registered_routers.insert(greenlist.begin(), greenlist.end());
|
||||
|
||||
for (const auto& rid : whitelist)
|
||||
known_rids.insert(rid);
|
||||
|
||||
router_whitelist.clear();
|
||||
router_whitelist.insert(whitelist.begin(), whitelist.end());
|
||||
router_greylist.clear();
|
||||
|
|
|
@ -135,9 +135,9 @@ namespace llarp
|
|||
- gray: fully funded, but decommissioned routers
|
||||
- green: registered, but not fully-staked routers
|
||||
*/
|
||||
std::unordered_set<RouterID> router_whitelist;
|
||||
std::unordered_set<RouterID> router_greylist;
|
||||
std::unordered_set<RouterID> router_greenlist;
|
||||
std::set<RouterID> router_whitelist{};
|
||||
std::set<RouterID> router_greylist{};
|
||||
std::set<RouterID> router_greenlist{};
|
||||
|
||||
// All registered relays (service nodes)
|
||||
std::set<RouterID> registered_routers;
|
||||
|
@ -165,7 +165,7 @@ namespace llarp
|
|||
std::atomic<int> fetch_failures{0}, bootstrap_failures{0};
|
||||
|
||||
std::atomic<bool> _using_bootstrap_fallback{false}, _needs_rebootstrap{false},
|
||||
_needs_initial_fetch{true};
|
||||
_needs_initial_fetch{true}, _initial_completed{false};
|
||||
|
||||
bool
|
||||
want_rc(const RouterID& rid) const;
|
||||
|
@ -332,7 +332,7 @@ namespace llarp
|
|||
return known_rids;
|
||||
}
|
||||
|
||||
const std::unordered_set<RouterID>&
|
||||
const std::set<RouterID>&
|
||||
greylist() const
|
||||
{
|
||||
return router_greylist;
|
||||
|
|
Loading…
Reference in New Issue