Skip to content

Commit a39b1b3

Browse files
committed
dualopend: fix channel_type if we don't negotiate the default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent e25d973 commit a39b1b3

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lightningd/dual_open_control.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,6 +3312,7 @@ static void handle_psbt_changed(struct subd *dualopend,
33123312
struct openchannel2_psbt_payload *payload;
33133313
struct open_attempt *oa;
33143314
struct command *cmd;
3315+
struct channel_type *channel_type;
33153316

33163317
assert(channel->open_attempt);
33173318
oa = channel->open_attempt;
@@ -3321,13 +3322,17 @@ static void handle_psbt_changed(struct subd *dualopend,
33213322
&cid,
33223323
&channel->req_confirmed_ins[REMOTE],
33233324
&funding_serial,
3324-
&psbt)) {
3325+
&psbt,
3326+
&channel_type)) {
33253327
channel_internal_error(channel,
33263328
"Bad DUALOPEND_PSBT_CHANGED: %s",
33273329
tal_hex(tmpctx, msg));
33283330
return;
33293331
}
33303332

3333+
/* This is often the first time we hear about channel details */
3334+
tal_free(channel->type);
3335+
channel->type = tal_steal(channel, channel_type);
33313336

33323337
switch (oa->role) {
33333338
case TX_INITIATOR:

openingd/dualopend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ fetch_psbt_changes(struct state *state,
14391439
msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
14401440
state->require_confirmed_inputs[REMOTE],
14411441
tx_state->funding_serial,
1442-
psbt);
1442+
psbt, state->channel_type);
14431443

14441444
wire_sync_write(REQ_FD, take(msg));
14451445

openingd/dualopend_wire.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ msgdata,dualopend_psbt_changed,channel_id,channel_id,
180180
msgdata,dualopend_psbt_changed,requires_confirmed_inputs,bool,
181181
msgdata,dualopend_psbt_changed,funding_serial,u64,
182182
msgdata,dualopend_psbt_changed,psbt,wally_psbt,
183+
msgdata,dualopend_psbt_changed,channel_type,channel_type,
183184

184185
# master->dualopend: we updated the psbt
185186
msgtype,dualopend_psbt_updated,7108

0 commit comments

Comments
 (0)