| 1474 | } |
| 1475 | |
| 1476 | static struct channel_id **unused_chans(const tal_t *ctx, |
| 1477 | struct splice_script_chan **channels, |
| 1478 | struct token **tokensA, |
| 1479 | size_t a_size, |
| 1480 | struct token **tokensB, |
| 1481 | size_t b_size) |
| 1482 | { |
| 1483 | struct channel_id **result = tal_arr(ctx, struct channel_id*, 0); |
| 1484 | |
| 1485 | for (size_t i = 0; i < tal_count(channels); i++) { |
| 1486 | bool used = false; |
| 1487 | for (size_t j = 0; j < a_size; j++) |
| 1488 | if (matches_chan_id(tokensA[j], channels[i]->chan_id)) |
| 1489 | used = true; |
| 1490 | for (size_t k = 0; k < b_size; k++) |
| 1491 | if (matches_chan_id(tokensB[k], channels[i]->chan_id)) |
| 1492 | used = true; |
| 1493 | if (!used) |
| 1494 | tal_arr_expand(&result, tal_dup(result, |
| 1495 | struct channel_id, |
| 1496 | &channels[i]->chan_id)); |
| 1497 | } |
| 1498 | |
| 1499 | if (!tal_count(result)) |
| 1500 | result = tal_free(result); |
| 1501 | |
| 1502 | return result; |
| 1503 | } |
| 1504 | |
| 1505 | static struct channel_id **unused_chans_for_node(const tal_t *ctx, |
| 1506 | struct splice_script_chan **channels, |
no test coverage detected