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

Function collect_htlcs

channeld/channeld.c:1006–1025  ·  view source on GitHub ↗

Collect the htlcs for call to hsmd. */

Source from the content-addressed store, hash-verified

1004
1005/* Collect the htlcs for call to hsmd. */
1006static struct simple_htlc **collect_htlcs(const tal_t *ctx, const struct htlc **htlc_map)
1007{
1008 struct simple_htlc **htlcs;
1009
1010 htlcs = tal_arr(ctx, struct simple_htlc *, 0);
1011 size_t num_entries = tal_count(htlc_map);
1012 for (size_t ndx = 0; ndx < num_entries; ++ndx) {
1013 struct htlc const *hh = htlc_map[ndx];
1014 if (hh) {
1015 struct simple_htlc *simple =
1016 new_simple_htlc(htlcs,
1017 htlc_state_owner(hh->state),
1018 hh->amount,
1019 &hh->rhash,
1020 hh->expiry.locktime);
1021 tal_arr_expand(&htlcs, simple);
1022 }
1023 }
1024 return htlcs;
1025}
1026
1027/* Returns HTLC sigs, sets commit_sig */
1028static struct bitcoin_signature *calc_commitsigs(const tal_t *ctx,

Callers 2

calc_commitsigsFunction · 0.85
handle_peer_commit_sigFunction · 0.85

Calls 2

new_simple_htlcFunction · 0.85
htlc_state_ownerFunction · 0.85

Tested by

no test coverage detected