Skip to content

Commit

Permalink
dualopend: fix channel_type if we don't negotiate the default.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Nov 12, 2023
1 parent fe89a41 commit db0aa59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lightningd/dual_open_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -3310,6 +3310,7 @@ static void handle_psbt_changed(struct subd *dualopend,
struct openchannel2_psbt_payload *payload;
struct open_attempt *oa;
struct command *cmd;
struct channel_type *channel_type;

assert(channel->open_attempt);
oa = channel->open_attempt;
Expand All @@ -3319,13 +3320,17 @@ static void handle_psbt_changed(struct subd *dualopend,
&cid,
&channel->req_confirmed_ins[REMOTE],
&funding_serial,
&psbt)) {
&psbt,
&channel_type)) {
channel_internal_error(channel,
"Bad DUALOPEND_PSBT_CHANGED: %s",
tal_hex(tmpctx, msg));
return;
}

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

switch (oa->role) {
case TX_INITIATOR:
Expand Down
2 changes: 1 addition & 1 deletion openingd/dualopend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ fetch_psbt_changes(struct state *state,
msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
state->require_confirmed_inputs[REMOTE],
tx_state->funding_serial,
psbt);
psbt, state->channel_type);

wire_sync_write(REQ_FD, take(msg));

Expand Down
1 change: 1 addition & 0 deletions openingd/dualopend_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ msgdata,dualopend_psbt_changed,channel_id,channel_id,
msgdata,dualopend_psbt_changed,requires_confirmed_inputs,bool,
msgdata,dualopend_psbt_changed,funding_serial,u64,
msgdata,dualopend_psbt_changed,psbt,wally_psbt,
msgdata,dualopend_psbt_changed,channel_type,channel_type,

# master->dualopend: we updated the psbt
msgtype,dualopend_psbt_updated,7108
Expand Down

0 comments on commit db0aa59

Please sign in to comment.