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