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