MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetChance

Method GetChance

src/addrman.cpp:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Select_Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected