| 1503 | } |
| 1504 | |
| 1505 | static struct channel_id **unused_chans_for_node(const tal_t *ctx, |
| 1506 | struct splice_script_chan **channels, |
| 1507 | struct token **tokensA, |
| 1508 | size_t a_size, |
| 1509 | struct token **tokensB, |
| 1510 | size_t b_size, |
| 1511 | struct node_id node_id) |
| 1512 | { |
| 1513 | struct channel_id **result = tal_arr(ctx, struct channel_id*, 0); |
| 1514 | |
| 1515 | for (size_t i = 0; i < tal_count(channels); i++) { |
| 1516 | bool used = false; |
| 1517 | if (!node_id_eq(&node_id, &channels[i]->node_id)) |
| 1518 | continue; |
| 1519 | for (size_t j = 0; j < a_size; j++) |
| 1520 | if (matches_chan_id(tokensA[j], channels[i]->chan_id)) |
| 1521 | used = true; |
| 1522 | for (size_t k = 0; k < b_size; k++) |
| 1523 | if (matches_chan_id(tokensB[k], channels[i]->chan_id)) |
| 1524 | used = true; |
| 1525 | if (!used) |
| 1526 | tal_arr_expand(&result, tal_dup(result, |
| 1527 | struct channel_id, |
| 1528 | &channels[i]->chan_id)); |
| 1529 | } |
| 1530 | |
| 1531 | if (!tal_count(result)) |
| 1532 | result = tal_free(result); |
| 1533 | |
| 1534 | return result; |
| 1535 | } |
| 1536 | |
| 1537 | static bool parse_channel_index(struct token *token, size_t *channel_index) |
| 1538 | { |
no test coverage detected