subd: keep track of 'channel's type

Back in the days before dual-funding, the `channel` struct on subd was
only every one type per daemon (either struct channel or struct
uncommitted_channel)

The RBF requirement on dualopend means that dualopend's channel,
however, can now be two different things -- either channel or
uncommitted_channel.

To track the difference/disambiguate, we now track the channel type on a
flag on the subd. It gets updated when we swap out the channel.
This commit is contained in:
niftynei
2020-12-01 14:49:35 -06:00
committed by Christian Decker
parent 0c520850b0
commit bf49bcfa90
7 changed files with 42 additions and 22 deletions

View File

@@ -588,7 +588,8 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
channel_set_owner(channel, new_channel_subd(ld,
"lightning_onchaind",
channel, &channel->peer->id,
channel, CHANNEL,
&channel->peer->id,
channel->log, false,
onchaind_wire_name,
onchain_msg,