initial_commit_tx, commit_tx: add anchor outputs if needed.

This also means we subtract 660 satoshis more everywhere we subtract
the base fee (except for mutual close, where the base fee is still
used).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-08-14 03:17:02 +09:30
parent 222d018b1a
commit e7423888ba
11 changed files with 268 additions and 30 deletions

View File

@@ -132,4 +132,8 @@ u8 *to_self_wscript(const tal_t *ctx,
/* To-other is simply: scriptpubkey_p2wpkh(tx, keyset->other_payment_key) */
/* If we determine we need one, append this anchor output */
void tx_add_anchor_output(struct bitcoin_tx *tx,
const struct pubkey *funding_key);
#endif /* LIGHTNING_COMMON_INITIAL_COMMIT_TX_H */