Based on #22831, this pull implements the suggestion in #22831 (comment) to extend RPC getnodeaddresses to return whether the address is in the tried or new table, and if it’s in the new table, its refcount. Doing so allows us to better test the contents of the addrman using a public interface instead of relying on assert_debug_log in the functional tests. The pull then updates the getnodeaddresses and addpeeraddress test coverage, followed by improving the relevant asmap test coverage.
Credit to John Newbery for the idea.