Skip to content

Commit

Permalink
dualopend: remove channel_update message creation.
Browse files Browse the repository at this point in the history
We don't have to generate these any more: lightningd does it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jan 31, 2024
1 parent d81f243 commit fc64215
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
3 changes: 0 additions & 3 deletions lightningd/dual_open_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -3629,9 +3629,6 @@ static unsigned int dual_opend_msg(struct subd *dualopend,
case WIRE_DUALOPEND_FAIL_FALLEN_BEHIND:
channel_fail_fallen_behind(dualopend, msg);
return 0;
/* FIXME: remove from dual_open_wire.csv */
case WIRE_DUALOPEND_LOCAL_PRIVATE_CHANNEL:
return 0;
case WIRE_DUALOPEND_VALIDATE_INPUTS:
handle_validate_inputs(dualopend, msg);
return 0;
Expand Down
36 changes: 0 additions & 36 deletions openingd/dualopend.c
Original file line number Diff line number Diff line change
Expand Up @@ -3882,38 +3882,6 @@ static void send_channel_ready(struct state *state)
billboard_update(state);
}

/* FIXME: Maybe cache this? */
static struct amount_sat channel_size(struct state *state)
{
u32 funding_outnum;
const u8 *funding_wscript =
bitcoin_redeem_2of2(tmpctx,
&state->our_funding_pubkey,
&state->their_funding_pubkey);

if (!find_txout(state->tx_state->psbt,
scriptpubkey_p2wsh(tmpctx, funding_wscript),
&funding_outnum)) {
open_err_fatal(state, "Cannot fund txout");
}

return psbt_output_get_amount(state->tx_state->psbt, funding_outnum);
}

static void tell_gossipd_new_channel(struct state *state)
{
u8 *msg;
const u8 *annfeatures = get_agreed_channelfeatures(tmpctx,
state->our_features,
state->their_features);

/* Tell lightningd about local channel. */
msg = towire_dualopend_local_private_channel(NULL,
channel_size(state),
annfeatures);
wire_sync_write(REQ_FD, take(msg));
}

static u8 *handle_funding_depth(struct state *state, u8 *msg)
{
u32 depth;
Expand All @@ -3928,9 +3896,6 @@ static u8 *handle_funding_depth(struct state *state, u8 *msg)
/* We check this before we arrive here, but for sanity */
assert(state->minimum_depth <= depth);

/* Tell gossipd the new channel exists before we tell peer. */
tell_gossipd_new_channel(state);

send_channel_ready(state);
if (state->channel_ready[REMOTE])
return towire_dualopend_channel_locked(state);
Expand Down Expand Up @@ -4211,7 +4176,6 @@ static u8 *handle_master_in(struct state *state)
case WIRE_DUALOPEND_FAIL_FALLEN_BEHIND:
case WIRE_DUALOPEND_DRY_RUN:
case WIRE_DUALOPEND_VALIDATE_LEASE:
case WIRE_DUALOPEND_LOCAL_PRIVATE_CHANNEL:
case WIRE_DUALOPEND_VALIDATE_INPUTS:
break;
}
Expand Down
6 changes: 0 additions & 6 deletions openingd/dualopend_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,3 @@ msgdata,dualopend_validate_lease,their_pubkey,pubkey,

msgtype,dualopend_validate_lease_reply,7127
msgdata,dualopend_validate_lease_reply,err_msg,?wirestring,

# Tell gossipd about this (as-yet) unannounced channel
msgtype,dualopend_local_private_channel,7015
msgdata,dualopend_local_private_channel,capacity,amount_sat,
msgdata,dualopend_local_private_channel,len,u16,
msgdata,dualopend_local_private_channel,features,u8,len

0 comments on commit fc64215

Please sign in to comment.