NULL peer: don't care about peer. NULL id: don't care about id */
| 64 | |
| 65 | /* NULL peer: don't care about peer. NULL id: don't care about id */ |
| 66 | static struct commando *find_commando(struct commando **arr, |
| 67 | const struct node_id *peer, |
| 68 | const u64 *id) |
| 69 | { |
| 70 | for (size_t i = 0; i < tal_count(arr); i++) { |
| 71 | if (id && arr[i]->id != *id) |
| 72 | continue; |
| 73 | if (peer && !node_id_eq(&arr[i]->peer, peer)) |
| 74 | continue; |
| 75 | return arr[i]; |
| 76 | } |
| 77 | return NULL; |
| 78 | } |
| 79 | |
| 80 | static void destroy_commando(struct commando *commando, struct commando ***arr) |
| 81 | { |
no test coverage detected