Collect the htlcs for call to hsmd. */
| 1004 | |
| 1005 | /* Collect the htlcs for call to hsmd. */ |
| 1006 | static 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 */ |
| 1028 | static struct bitcoin_signature *calc_commitsigs(const tal_t *ctx, |
no test coverage detected