lightningd: use channel_type, pass to-and-from channeld.

Instead of explicit option_static_remotekey and option_anchor_outputs flags.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-09-09 14:59:35 +09:30
committed by Christian Decker
parent 740afb822c
commit 183fe107e8
57 changed files with 245 additions and 230 deletions

View File

@@ -199,6 +199,7 @@ void peer_start_closingd(struct channel *channel,
int hsmfd;
struct lightningd *ld = channel->peer->ld;
u32 final_commit_feerate;
bool option_anchor_outputs = channel_has(channel, OPT_ANCHOR_OUTPUTS);
if (!channel->shutdown_scriptpubkey[REMOTE]) {
channel_internal_error(channel,
@@ -243,7 +244,7 @@ void peer_start_closingd(struct channel *channel,
final_commit_feerate = get_feerate(channel->fee_states,
channel->opener, LOCAL);
feelimit = commit_tx_base_fee(final_commit_feerate, 0,
channel->option_anchor_outputs);
option_anchor_outputs);
/* If we can't determine feerate, start at half unilateral feerate. */
feerate = mutual_close_feerate(ld->topology);
@@ -255,7 +256,7 @@ void peer_start_closingd(struct channel *channel,
/* We use a feerate if anchor_outputs, otherwise max fee is set by
* the final unilateral. */
if (channel->option_anchor_outputs) {
if (option_anchor_outputs) {
max_feerate = tal(tmpctx, u32);
/* Aim for reasonable max, but use final if we don't know. */
*max_feerate = unilateral_feerate(ld->topology);
@@ -316,7 +317,7 @@ void peer_start_closingd(struct channel *channel,
(channel->closing_fee_negotiation_step == 50
&& channel->closing_fee_negotiation_step_unit == CLOSING_FEE_NEGOTIATION_STEP_UNIT_PERCENTAGE)
/* Always use quickclose with anchors */
|| channel->option_anchor_outputs,
|| option_anchor_outputs,
IFDEV(ld->dev_fast_gossip, false),
channel->shutdown_wrong_funding);