mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-09 04:02:25 +01:00
5c832c3820p2p, refactor: return `std::optional<CNetAddr>` in `LookupHost` (brunoerg)34bcdfc6a6p2p, refactor: return vector/optional<CService> in `Lookup` (brunoerg)7799eb125bp2p, refactor: return `std::vector<CNetAddr>` in `LookupHost` (brunoerg)5c1774a563p2p, refactor: return `std::vector<CNetAddr>` in `LookupIntern` (brunoerg) Pull request description: Continuation of #26078. To improve readability instead of returning a bool and passing stuff by reference, this PR changes: - `LookupHost` to return `std::vector<CNetAddr>` - `LookupHost` to return `std::optional<CNetAddr>` - `Lookup` to return `std::vector<CService>` - `Lookup` to return `std::optional<CService>`. - `LookupIntern` to return `std::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. ACKs for top commit: achow101: ACK5c832c3820stickies-v: re-ACK5c832c3820- just addressing two nits, no other changes theStack: re-ACK5c832c3820Tree-SHA512: ea346fdc54463999646269bd600cd4a1590ef958001d2f0fc2be608ca51e1b4365efccca76dd4972b023e12fcc6e67d226608b0df7beb901bdeadd19948df840
5.4 KiB
5.4 KiB