MCPcopy Create free account
hub / github.com/ElementsProject/lightning / unused_chans

Function unused_chans

common/splice_script.c:1476–1503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1474}
1475
1476static 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
1505static struct channel_id **unused_chans_for_node(const tal_t *ctx,
1506 struct splice_script_chan **channels,

Callers 1

resolve_channel_idsFunction · 0.85

Calls 2

matches_chan_idFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected