Continuation of #26078.
To improve readability instead of returning a bool and passing stuff by reference, this PR changes:
LookupHostto returnstd::vector<CNetAddr>LookupHostto returnstd::optional<CNetAddr>Lookupto returnstd::vector<CService>Lookupto returnstd::optional<CService>.LookupInternto returnstd::vector<CNetAddr>
As discussed in #26078, it would be better to avoid using optional in some cases, but for specific Lookup and LookupHost functions it’s necessary to use optional to verify if they were able to catch some data from their overloaded function.