| 53 | } |
| 54 | |
| 55 | static void add_offered_htlc_out(struct bitcoin_tx *tx, size_t n, |
| 56 | const struct htlc *htlc, |
| 57 | const struct keyset *keyset, |
| 58 | bool option_anchor_outputs) |
| 59 | { |
| 60 | struct ripemd160 ripemd; |
| 61 | u8 *wscript, *p2wsh; |
| 62 | struct amount_sat amount = amount_msat_to_sat_round_down(htlc->amount); |
| 63 | |
| 64 | ripemd160(&ripemd, htlc->rhash.u.u8, sizeof(htlc->rhash.u.u8)); |
| 65 | wscript = htlc_offered_wscript(tx, &ripemd, keyset, |
| 66 | option_anchor_outputs); |
| 67 | p2wsh = scriptpubkey_p2wsh(tx, wscript); |
| 68 | bitcoin_tx_add_output(tx, p2wsh, wscript, amount); |
| 69 | SUPERVERBOSE("# HTLC #%" PRIu64 " offered amount %"PRIu64" wscript %s\n", htlc->id, |
| 70 | amount.satoshis, /* Raw: BOLT 3 output match */ |
| 71 | tal_hex(wscript, wscript)); |
| 72 | tal_free(wscript); |
| 73 | } |
| 74 | |
| 75 | static void add_received_htlc_out(struct bitcoin_tx *tx, size_t n, |
| 76 | const struct htlc *htlc, |
no test coverage detected