HomePhabricator

Make CAddrman::Select_ select buckets, not positions, first

Description

Make CAddrman::Select_ select buckets, not positions, first

Summary:

The original CAddrMan behaviour (before commit
e6b343d880f50d52390c5af8623afa15fcbc65a2) was to pick a uniformly random non-empty bucket, and then pick a random element from that bucket. That commit, which introduced deterministic placement of entries in buckets, changed this to picking a uniformly random non-empty bucket position instead.

This commit reverts the original high-level behavior, but in the deterministic placement model.

Backport of core#23140.

Depends on D12339.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D12340

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Sep 29 2021, 20:22
FabienCommitted on Oct 21 2022, 08:34
FabienPushed on Oct 21 2022, 08:34
Reviewer
Restricted Project
Differential Revision
D12340: Make CAddrman::Select_ select buckets, not positions, first
Parents
rABC1136c0b57542: log: improve addrman logging
Branches
Unknown
Tags
Unknown