| 73 | } |
| 74 | |
| 75 | double 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 | |
| 90 | AddrManImpl::AddrManImpl(const NetGroupManager& netgroupman, bool deterministic, int32_t consistency_check_ratio) |
| 91 | : insecure_rand{deterministic} |