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

Method GetChance

src/addrman.cpp:75–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75double AddrInfo::GetChance(NodeSeconds now) const
76{
77 double fChance = 1.0;
78
79 // deprioritize very recent attempts away
80 if (now - m_last_try < 10min) {
81 fChance *= 0.01;
82 }
83
84 // deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages.
85 fChance *= pow(0.66, std::min(nAttempts, 8));
86
87 return fChance;
88}
89
90AddrManImpl::AddrManImpl(const NetGroupManager& netgroupman, bool deterministic, int32_t consistency_check_ratio)
91 : insecure_rand{deterministic}

Callers 1

Select_Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected