MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetChance

Method GetChance

src/addrman.cpp:56–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56double CAddrInfo::GetChance(int64_t nNow) const
57{
58 double fChance = 1.0;
59 int64_t nSinceLastTry = std::max<int64_t>(nNow - nLastTry, 0);
60
61 // deprioritize very recent attempts away
62 if (nSinceLastTry < 60 * 10)
63 fChance *= 0.01;
64
65 // deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages.
66 fChance *= pow(0.66, min(nAttempts, 8));
67
68 return fChance;
69}
70
71CAddrInfo* CAddrMan::Find(const CNetAddr& addr, int* pnId)
72{

Callers 1

Select_Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected