Page MenuHomePhabricator

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

Authored by Fabien on Oct 20 2022, 13:22.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable