NULL peer: don't care about peer. NULL id: don't care about id */
| 85 | |
| 86 | /* NULL peer: don't care about peer. NULL id: don't care about id */ |
| 87 | static struct commando *find_commando(struct commando **arr, |
| 88 | const struct node_id *peer, |
| 89 | const u64 *id) |
| 90 | { |
| 91 | for (size_t i = 0; i < tal_count(arr); i++) { |
| 92 | if (id && arr[i]->id != *id) |
| 93 | continue; |
| 94 | if (peer && !node_id_eq(&arr[i]->peer, peer)) |
| 95 | continue; |
| 96 | return arr[i]; |
| 97 | } |
| 98 | return NULL; |
| 99 | } |
| 100 | |
| 101 | static void destroy_commando(struct commando *commando, struct commando ***arr) |
| 102 | { |
no test coverage detected