1 suggestion
Optional improvements
[suggestion] · Saturation-only assertions leave addnode slot refill untested
The functional test verifies initial saturation but never frees a slot, so a regression that prevents subsequent addnode retries would still satisfy its assertions.
Location: test/functional/rpc_addnode_limits.py:69 (head).
Details and suggested fix
After reaching eight connections, ensure_for checks only <= 8 for two seconds. It cannot detect failure to refill a freed slot. Consider disconnecting one manual peer, waiting until its peer ID disappears from getpeerinfo, and then waiting for eight manual connections again. The disappearance check matters because disconnectnode only sets fDisconnect; an immediate count check could accept the original eight peers. Assert on the restored count rather than requiring target nine, since the dropped entry remains eligible for reconnection. Allow a timeout comfortably above the worker's 60-second retry sleep, rather than the default 60 seconds. This additional coverage can add about a minute to the test's runtime.