Page MenuHomePhabricator

Add a method to make addrman deterministic
ClosedPublic

Authored by Fabien on Aug 4 2022, 20:20.

Details

Reviewers
sdulfari
Group Reviewers
Restricted Project
Commits
rABCbb9328ffcfe2: Add a method to make addrman deterministic
Summary

This is actually done in tests by subclassing CAddrMan, but making it part of the main CAddrMan class makes it possible to use a deterministic address manager as a member of CConnman. There is no change in behavior.

Test Plan
ninja all check-all

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Aug 4 2022, 20:20
sdulfari requested changes to this revision.Aug 4 2022, 22:58
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/addrman.h
814–816 ↗(On Diff #34587)

This has better code reuse and makes it much more likely that tests will break cleanly if MakeDeterministic is called part way through the test for some reason.

This revision now requires changes to proceed.Aug 4 2022, 22:58

Improve as per feedback

This revision is now accepted and ready to land.Aug 6 2022, 08:11
This revision was automatically updated to reflect the committed changes.