MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / GetRouterProfile

Function GetRouterProfile

libi2pd/Profiling.cpp:264–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262 }
263
264 std::shared_ptr<RouterProfile> GetRouterProfile (const IdentHash& identHash)
265 {
266 {
267 std::unique_lock<std::mutex> l(g_ProfilesMutex);
268 auto it = g_Profiles.find (identHash);
269 if (it != g_Profiles.end ())
270 {
271 it->second->SetLastAccessTime (i2p::util::GetSecondsSinceEpoch ());
272 return it->second;
273 }
274 }
275 auto profile = netdb.NewRouterProfile ();
276 profile->Load (identHash); // if possible
277 std::lock_guard<std::mutex> l(g_ProfilesMutex);
278 g_Profiles.emplace (identHash, profile);
279 return profile;
280 }
281
282 bool IsRouterBanned (const IdentHash& identHash)
283 {

Callers 5

Profiling.cppFile · 0.85
GetProfileMethod · 0.85

Calls 4

GetSecondsSinceEpochFunction · 0.85
SetLastAccessTimeMethod · 0.80
NewRouterProfileMethod · 0.80
LoadMethod · 0.45

Tested by

no test coverage detected