Ava Chow
75353a0163
Merge bitcoin/bitcoin#32326 : net: improve the interface around FindNode() and avoid a recursive mutex lock
...
87e7f37918 doc: clarify peer address in getpeerinfo and addnode RPC help (Vasil Dimov)
2a4450ccbb net: change FindNode() to not return a node and rename it (Vasil Dimov)
4268abae1a net: avoid recursive m_nodes_mutex lock in DisconnectNode() (Vasil Dimov)
3a4d1a25cf net: merge AlreadyConnectedToAddress() and FindNode(CNetAddr) (Vasil Dimov)
Pull request description:
`CConnman::FindNode()` would lock `m_nodes_mutex`, find the node in `m_nodes`, release the mutex and return the node. The current code is safe but it is a dangerous interface where a caller may end up using the node returned from `FindNode()` without owning `m_nodes_mutex` and without having that node's reference count incremented.
Change `FindNode()` to return a boolean since all but one of its callers used its return value to check whether a node exists and did not do anything else with the return value.
Remove a recursive lock on `m_nodes_mutex`.
Rename `FindNode()` to better describe what it does.
ACKs for top commit:
achow101:
ACK 87e7f37918
furszy:
Code review ACK 87e7f37918
hodlinator:
re-ACK 87e7f37918
Tree-SHA512: 44fb64cd1226eca124ed1f447b4a1ebc42cc5c9e8561fc91949bbeaeaa7fa16fcfd664e85ce142e5abe62cb64197c178ca4ca93b3b3217b913e3c498d0b7d1c9
2025-10-01 14:17:22 -07:00
..
2025-09-10 08:03:17 -04:00
2025-09-25 14:36:40 -07:00
2025-09-16 06:26:01 -04:00
2025-08-11 16:47:43 +01:00
2025-08-07 09:27:25 +01:00
2025-09-08 18:39:55 +01:00
2025-09-07 17:28:31 +02:00
2025-09-17 04:57:09 -04:00
2025-09-17 04:57:09 -04:00
2025-09-17 05:30:43 -04:00
2025-09-11 13:46:20 -07:00
2025-05-30 16:51:49 +01:00
2025-02-21 10:43:01 +01:00
2025-05-13 18:07:47 +01:00
2025-09-25 08:18:20 -04:00
2025-08-21 15:16:54 +02:00
2025-08-11 16:47:51 +01:00
2025-09-10 12:26:58 +01:00
2025-10-01 16:39:56 +02:00
2025-08-06 09:33:17 -04:00
2025-07-22 09:35:01 +01:00
2025-05-23 10:09:39 +01:00
2025-10-01 14:17:22 -07:00
2025-07-23 13:29:07 -07:00
2025-09-30 15:59:09 -07:00
2025-09-29 13:59:44 -04:00
2025-08-11 16:47:43 +01:00
2025-06-03 15:13:54 +02:00
2025-07-10 11:24:40 +02:00
2024-07-30 14:06:58 -04:00
2025-03-23 21:58:39 +01:00
2024-09-20 12:55:22 -04:00
2024-11-11 12:47:53 -03:00
2024-11-11 12:47:53 -03:00
2025-01-09 10:11:46 -05:00
2025-09-11 16:50:26 +02:00
2025-07-25 09:50:50 +02:00
2025-05-19 16:40:33 +01:00
2025-06-03 15:13:54 +02:00
2025-03-12 19:46:54 +01:00
2025-06-03 15:13:57 +02:00
2025-06-03 15:13:57 +02:00
2025-06-03 19:56:55 +02:00
2025-03-12 19:46:54 +01:00
2025-09-05 15:46:44 +01:00
2025-06-10 15:14:24 +02:00
2025-08-04 15:33:25 -06:00
2025-06-10 15:14:24 +02:00
2025-06-10 15:14:24 +02:00
2025-05-17 09:36:25 +02:00
2025-06-10 15:14:24 +02:00
2025-01-15 12:15:40 +01:00
2025-06-10 15:14:24 +02:00
2025-05-09 15:07:04 +02:00
2025-09-17 04:57:09 -04:00
2025-06-10 15:14:24 +02:00
2025-09-17 04:57:09 -04:00
2025-08-27 03:33:32 +10:00
2025-08-27 03:33:32 +10:00
2024-05-16 10:16:08 -05:00
2025-08-13 00:08:37 -03:00
2025-08-13 00:08:37 -03:00
2025-07-25 09:50:50 +02:00
2025-06-03 15:13:57 +02:00
2024-11-14 13:41:02 -05:00
2025-09-03 11:23:30 +01:00
2025-05-19 22:06:48 +00:00
2025-05-20 09:30:41 +01:00
2025-05-29 11:18:36 +01:00
2025-07-14 09:41:17 -04:00
2025-09-17 04:57:09 -04:00
2024-12-04 14:09:05 -05:00
2025-06-03 15:13:57 +02:00
2025-03-12 19:46:54 +01:00
2024-11-26 20:47:08 -05:00
2025-04-22 13:16:54 +01:00
2025-01-22 17:31:22 -05:00
2025-05-19 16:40:33 +01:00
2025-08-06 15:46:18 -07:00
2025-07-22 10:26:15 -07:00
2025-04-30 14:51:21 +02:00
2025-04-30 14:51:21 +02:00
2025-02-21 10:41:27 +01:00
2025-01-21 00:38:03 +10:00
2025-07-25 09:50:50 +02:00
2024-08-13 07:44:31 +02:00
2025-06-16 15:33:19 +02:00
2024-07-24 09:39:35 +02:00
2025-03-12 19:46:54 +01:00
2025-03-12 19:46:54 +01:00
2025-09-02 11:59:48 +01:00
2025-08-11 16:47:43 +01:00
2025-07-03 06:26:23 -04:00
2025-09-16 06:26:01 -04:00
2024-11-04 17:08:21 +01:00
2025-06-09 14:17:33 +02:00
2025-06-09 14:17:33 +02:00
2025-09-30 15:23:20 -07:00
2025-01-16 21:06:21 +00:00
2025-06-03 15:13:57 +02:00
2025-09-16 21:46:18 +02:00
2025-03-12 19:46:54 +01:00
2025-08-12 11:28:36 -04:00
2025-08-12 11:28:36 -04:00
2025-09-08 11:18:51 +02:00
2025-07-17 12:43:04 -04:00
2024-11-04 18:46:40 +01:00
2025-08-11 15:53:34 +01:00
2025-08-11 16:47:51 +01:00
2025-06-11 11:11:48 -07:00
2025-08-01 12:07:26 +01:00
2024-05-16 10:16:08 -05:00
2025-02-21 10:41:27 +01:00
2025-09-23 10:29:23 -04:00
2025-09-22 10:46:26 +10:00
2024-05-20 16:48:19 +00:00
2024-07-08 11:12:01 +02:00
2025-10-01 14:17:22 -07:00
2025-10-01 14:17:22 -07:00
2025-06-03 08:09:21 +01:00
2025-03-12 19:46:54 +01:00
2025-09-16 06:26:01 -04:00
2025-08-04 13:38:26 -04:00
2025-07-25 09:50:50 +02:00
2025-07-25 09:50:50 +02:00
2025-06-18 18:11:28 -03:00
2025-06-18 18:11:28 -03:00
2025-04-22 17:11:24 +10:00
2025-06-03 15:13:57 +02:00
2025-07-25 16:23:37 -07:00
2025-07-08 20:00:51 +01:00
2025-07-08 20:00:51 +01:00
2025-05-14 14:00:43 -07:00
2025-05-14 14:00:43 -07:00
2025-05-21 10:44:26 -07:00
2025-05-21 10:44:26 -07:00
2025-07-25 09:50:50 +02:00
2025-07-16 13:19:18 -07:00
2025-05-08 16:49:58 +01:00
2025-08-11 16:26:35 +01:00
2025-06-16 18:09:14 +00:00
2025-05-10 03:31:30 +00:00
2025-07-29 16:25:47 -07:00
2025-08-11 16:47:43 +01:00
2025-03-12 19:46:54 +01:00
2025-07-16 14:33:07 -07:00
2025-07-16 14:33:07 -07:00
2025-08-22 14:25:39 +00:00
2025-08-22 14:25:39 +00:00
2025-05-08 20:13:46 +00:00
2025-01-15 12:16:08 +01:00
2025-05-13 12:09:40 +02:00
2025-05-13 12:09:40 +02:00
2025-04-07 15:59:41 +02:00
2025-01-15 15:44:55 +01:00
2025-09-10 08:03:17 -04:00
2025-09-10 08:03:17 -04:00
2025-08-27 03:33:32 +10:00
2025-08-27 03:33:32 +10:00
2025-07-23 15:01:18 +01:00
2025-07-23 15:01:18 +01:00
2025-04-09 15:59:59 +01:00
2025-04-09 15:59:59 +01:00
2025-08-21 15:54:02 +01:00
2025-08-20 10:45:36 -07:00
2025-08-01 15:12:37 +02:00
2025-08-01 15:12:37 +02:00
2025-01-21 00:38:03 +10:00
2025-04-30 14:51:21 +02:00
2025-04-30 14:51:21 +02:00
2024-07-08 11:12:01 +02:00