closingd: add support for handling wrong_funding.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-03-16 06:55:54 +10:30
parent 820fbcd65a
commit 1cfb7b84d0
7 changed files with 134 additions and 65 deletions

View File

@@ -286,30 +286,31 @@ void peer_start_closingd(struct channel *channel,
return;
}
initmsg = towire_closingd_init(tmpctx,
chainparams,
pps,
&channel->cid,
&channel->funding_txid,
channel->funding_outnum,
channel->funding,
&channel->local_funding_pubkey,
&channel->channel_info.remote_fundingkey,
channel->opener,
amount_msat_to_sat_round_down(channel->our_msat),
amount_msat_to_sat_round_down(their_msat),
channel->our_config.dust_limit,
minfee, feelimit, startfee,
channel->shutdown_scriptpubkey[LOCAL],
channel->shutdown_scriptpubkey[REMOTE],
channel->closing_fee_negotiation_step,
channel->closing_fee_negotiation_step_unit,
reconnected,
channel->next_index[LOCAL],
channel->next_index[REMOTE],
num_revocations,
channel_reestablish,
&last_remote_per_commit_secret,
IFDEV(ld->dev_fast_gossip, false));
chainparams,
pps,
&channel->cid,
&channel->funding_txid,
channel->funding_outnum,
channel->funding,
&channel->local_funding_pubkey,
&channel->channel_info.remote_fundingkey,
channel->opener,
amount_msat_to_sat_round_down(channel->our_msat),
amount_msat_to_sat_round_down(their_msat),
channel->our_config.dust_limit,
minfee, feelimit, startfee,
channel->shutdown_scriptpubkey[LOCAL],
channel->shutdown_scriptpubkey[REMOTE],
channel->closing_fee_negotiation_step,
channel->closing_fee_negotiation_step_unit,
reconnected,
channel->next_index[LOCAL],
channel->next_index[REMOTE],
num_revocations,
channel_reestablish,
&last_remote_per_commit_secret,
IFDEV(ld->dev_fast_gossip, false),
channel->shutdown_wrong_funding);
/* We don't expect a response: it will give us feedback on
* signatures sent and received, then closing_complete. */