Page MenuHomePhabricator

[avalanche] Account for the avalanche outbound when checking for outbound eviction
ClosedPublic

Authored by Fabien on Jul 26 2022, 15:33.

Details

Summary

Periodically the node checks if there is more outbound that the maximum configured and evict any extra. The count of extra outbound did not take into account the avalanche outbounds and will evict way too early. This diff fixes this issue and add a unit test for the GetExtraFullOutboundCount() method.

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.Jul 26 2022, 15:33
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/test/net_tests.cpp
1008 ↗(On Diff #34516)

Nit: Instead of hand picking values, just loop through some reasonable values and calculate the expected count from those.

This revision is now accepted and ready to land.Jul 26 2022, 15:42
src/test/net_tests.cpp
1008 ↗(On Diff #34516)

Using computed values here will likely make the test less readable, I'll go ahead with this version