Andrew Chow
71300489af
Merge bitcoin/bitcoin#26261 : p2p: cleanup LookupIntern, Lookup and LookupHost
...
5c832c3820253affc65c0ed490e26e5b0a4d5c9b p2p, refactor: return `std::optional<CNetAddr>` in `LookupHost` (brunoerg)
34bcdfc6a65de906c65edccdd96fe15219081cd2 p2p, refactor: return vector/optional<CService> in `Lookup` (brunoerg)
7799eb125b7a1146f8251be5d26df574236212a9 p2p, refactor: return `std::vector<CNetAddr>` in `LookupHost` (brunoerg)
5c1774a563dcc237a88df69569cd94fe81e908f7 p2p, 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:
ACK 5c832c3820253affc65c0ed490e26e5b0a4d5c9b
stickies-v:
re-ACK 5c832c3820253affc65c0ed490e26e5b0a4d5c9b - just addressing two nits, no other changes
theStack:
re-ACK 5c832c3820253affc65c0ed490e26e5b0a4d5c9b
Tree-SHA512: ea346fdc54463999646269bd600cd4a1590ef958001d2f0fc2be608ca51e1b4365efccca76dd4972b023e12fcc6e67d226608b0df7beb901bdeadd19948df840
2023-05-30 11:39:59 -04:00
..
2023-05-30 11:39:59 -04:00
2023-05-30 14:57:22 +01:00
2023-04-03 14:44:48 +01:00
2023-02-06 13:56:51 -05:00
2022-08-13 13:55:38 +01:00
2023-05-04 20:58:01 +01:00
2023-05-17 11:14:28 -04:00
2023-04-19 10:48:30 +02:00
2023-05-25 10:45:38 -03:00
2023-05-20 12:08:13 +02:00
2023-05-30 15:32:19 +01:00
2022-09-29 16:43:30 +01:00
2023-01-31 18:48:50 +01:00
2022-10-23 15:03:04 +01:00
2023-05-30 15:32:19 +01:00
2023-05-20 12:08:13 +02:00
2022-12-24 23:49:50 +00:00
2023-05-30 11:39:59 -04:00
2023-05-30 11:39:59 -04:00
2023-05-20 12:08:13 +02:00
2023-04-14 10:35:51 -04:00
2023-03-23 19:38:38 +01:00
2023-05-30 11:39:59 -04:00
2023-05-09 18:48:10 +02:00
2023-05-30 14:57:22 +01:00
2023-05-30 16:20:47 +01:00
2023-05-26 13:41:07 -03:00
2022-04-26 10:43:33 +01:00
2023-03-26 20:18:13 +01:00
2023-05-29 13:12:45 +02:00
2023-05-29 13:26:31 +02:00
2023-03-17 17:59:02 -07:00
2023-03-17 17:59:02 -07:00
2023-03-17 18:02:40 -07:00
2022-12-24 23:49:50 +00:00
2023-02-01 11:33:35 +01:00
2023-05-04 20:57:51 +01:00
2023-05-20 12:08:13 +02:00
2023-03-23 12:55:18 +01:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-05-30 14:57:22 +01:00
2023-05-20 12:08:13 +02:00
2023-05-20 12:08:13 +02:00
2023-05-20 12:08:13 +02:00
2023-05-20 12:08:13 +02:00
2023-05-20 12:08:13 +02:00
2023-05-20 12:08:13 +02:00
2023-02-15 14:42:28 -08:00
2023-01-31 19:34:35 +01:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-01-05 09:05:14 +00:00
2023-05-25 19:24:05 +02:00
2023-05-25 19:24:05 +02:00
2023-05-10 10:39:58 +02:00
2023-05-10 10:39:58 +02:00
2023-04-20 06:08:22 -07:00
2023-03-21 13:04:21 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-03-23 19:38:38 +01:00
2023-03-23 19:38:38 +01:00
2023-02-03 18:15:42 +01:00
2023-01-26 10:44:05 +01:00
2023-05-20 12:08:13 +02:00
2023-01-31 11:50:10 +00:00
2023-03-23 12:55:18 +01:00
2023-03-23 12:55:18 +01:00
2023-03-15 16:42:42 +01:00
2023-03-15 16:42:42 +01:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-04-19 10:48:30 +02:00
2023-05-09 18:48:52 +02:00
2023-05-20 12:08:13 +02:00
2023-03-23 12:52:00 +01:00
2023-04-03 14:41:22 +01:00
2022-12-24 23:49:50 +00:00
2023-01-30 15:57:12 +00:00
2022-12-12 21:06:04 +00:00
2022-12-12 21:06:04 +00:00
2023-05-09 18:47:14 +02:00
2023-05-26 13:41:07 -03:00
2022-12-24 23:49:50 +00:00
2023-05-20 12:08:13 +02:00
2023-03-23 12:55:18 +01:00
2023-05-30 11:39:59 -04:00
2022-12-24 23:49:50 +00:00
2023-05-25 06:30:10 +00:00
2023-01-31 19:34:35 +01:00
2023-01-31 11:50:10 +00:00
2023-04-05 11:50:27 +01:00
2023-03-23 12:55:18 +01:00
2023-05-20 12:08:13 +02:00
2023-05-05 06:03:14 -06:00
2022-04-26 16:25:38 -04:00
2022-06-23 15:33:01 +02:00
2022-07-21 10:42:09 +01:00
2023-02-27 13:53:29 +00:00
2023-02-03 22:33:14 +01:00
2022-09-13 17:15:17 +01:00
2022-11-17 14:52:45 +00:00
2023-03-23 19:38:38 +01:00
2023-05-19 10:26:19 -04:00
2023-05-30 11:39:59 -04:00
2023-01-28 15:24:13 +00:00
2023-03-23 19:38:38 +01:00
2023-05-30 11:39:59 -04:00
2022-12-24 23:49:50 +00:00
2023-05-26 17:12:28 +01:00
2023-05-23 13:07:49 -04:00
2022-12-24 23:49:50 +00:00
2023-05-26 13:40:02 -03:00
2023-05-23 13:07:49 -04:00
2023-02-17 13:34:40 -05:00
2023-02-17 13:34:40 -05:00
2023-05-26 13:41:07 -03:00
2023-05-26 13:41:07 -03:00
2022-12-24 23:49:50 +00:00
2022-04-20 14:35:53 +01:00
2022-12-24 23:49:50 +00:00
2023-04-16 23:48:05 +02:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-05-20 12:08:13 +02:00
2022-12-24 23:49:50 +00:00
2023-04-21 14:06:12 -04:00
2023-04-21 14:06:12 -04:00
2023-01-13 09:40:57 +00:00
2023-01-13 09:40:57 +00:00
2023-05-20 17:20:01 +01:00
2023-02-15 14:58:47 +00:00
2023-04-03 14:44:48 +01:00
2023-05-20 12:03:33 +02:00
2023-01-12 13:42:44 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-01-31 11:50:10 +00:00
2023-02-28 12:04:47 -05:00
2023-05-20 12:08:13 +02:00
2023-01-31 11:50:10 +00:00
2023-05-05 06:03:17 -06:00
2023-01-25 09:33:26 +01:00
2023-04-19 10:48:30 +02:00
2022-12-24 23:49:50 +00:00
2023-01-31 11:50:10 +00:00
2023-05-26 13:40:02 -03:00
2023-03-23 12:55:18 +01:00
2023-05-24 08:55:47 -04:00
2023-05-29 13:26:31 +02:00
2023-05-20 12:08:13 +02:00
2023-03-27 17:35:12 -04:00
2023-01-26 10:36:18 +00:00
2023-01-26 10:36:18 +00:00
2023-05-18 12:24:40 +02:00
2022-12-10 14:34:44 -06:00
2023-02-06 13:56:51 -05:00
2023-05-30 14:57:22 +01:00
2023-05-20 12:03:26 +02:00
2023-02-01 11:33:35 +01:00
2023-01-05 09:05:14 +00:00
2023-01-03 19:31:29 -06:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-05-20 12:08:13 +02:00