Skip to content

Commit 861d26e

Browse files
committed
hsmd: Rename hsmd_ready_channel to hsmd_setup_channel
When BOLT-2 renamed funding_locked to channel_ready the hsmd message named ready_channel became very confusing. Change it to setup_channel instead to not confuse developers.not trigger the wrong association. Because the hsmd wire messages are parsed by number this change is forward and backwards compatible. Changelog-Changed: hsmd: Renamed hsmd_ready_channel to hsmd_setup_channel because of the BOLT-2 rename of funding_locked to channel_ready
1 parent bd9494c commit 861d26e

File tree

5 files changed

+39
-39
lines changed

5 files changed

+39
-39
lines changed

hsmd/hsmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ static struct io_plan *handle_client(struct io_conn *conn, struct client *c)
653653
#endif /* DEVELOPER */
654654

655655
case WIRE_HSMD_NEW_CHANNEL:
656-
case WIRE_HSMD_READY_CHANNEL:
656+
case WIRE_HSMD_SETUP_CHANNEL:
657657
case WIRE_HSMD_SIGN_COMMITMENT_TX:
658658
case WIRE_HSMD_VALIDATE_COMMITMENT_TX:
659659
case WIRE_HSMD_VALIDATE_REVOCATION:
@@ -698,7 +698,7 @@ static struct io_plan *handle_client(struct io_conn *conn, struct client *c)
698698
case WIRE_HSMD_CUPDATE_SIG_REPLY:
699699
case WIRE_HSMD_CLIENT_HSMFD_REPLY:
700700
case WIRE_HSMD_NEW_CHANNEL_REPLY:
701-
case WIRE_HSMD_READY_CHANNEL_REPLY:
701+
case WIRE_HSMD_SETUP_CHANNEL_REPLY:
702702
case WIRE_HSMD_NODE_ANNOUNCEMENT_SIG_REPLY:
703703
case WIRE_HSMD_SIGN_WITHDRAWAL_REPLY:
704704
case WIRE_HSMD_SIGN_INVOICE_REPLY:

hsmd/hsmd_wire.csv

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,25 @@ msgdata,hsmd_get_channel_basepoints_reply,funding_pubkey,pubkey,
6969

7070
#include <common/channel_type.h>
7171
# Provide channel parameters.
72-
msgtype,hsmd_ready_channel,31
73-
msgdata,hsmd_ready_channel,is_outbound,bool,
74-
msgdata,hsmd_ready_channel,channel_value,amount_sat,
75-
msgdata,hsmd_ready_channel,push_value,amount_msat,
76-
msgdata,hsmd_ready_channel,funding_txid,bitcoin_txid,
77-
msgdata,hsmd_ready_channel,funding_txout,u16,
78-
msgdata,hsmd_ready_channel,local_to_self_delay,u16,
79-
msgdata,hsmd_ready_channel,local_shutdown_script_len,u16,
80-
msgdata,hsmd_ready_channel,local_shutdown_script,u8,local_shutdown_script_len
81-
msgdata,hsmd_ready_channel,local_shutdown_wallet_index,?u32,
82-
msgdata,hsmd_ready_channel,remote_basepoints,basepoints,
83-
msgdata,hsmd_ready_channel,remote_funding_pubkey,pubkey,
84-
msgdata,hsmd_ready_channel,remote_to_self_delay,u16,
85-
msgdata,hsmd_ready_channel,remote_shutdown_script_len,u16,
86-
msgdata,hsmd_ready_channel,remote_shutdown_script,u8,remote_shutdown_script_len
87-
msgdata,hsmd_ready_channel,channel_type,channel_type,
72+
msgtype,hsmd_setup_channel,31
73+
msgdata,hsmd_setup_channel,is_outbound,bool,
74+
msgdata,hsmd_setup_channel,channel_value,amount_sat,
75+
msgdata,hsmd_setup_channel,push_value,amount_msat,
76+
msgdata,hsmd_setup_channel,funding_txid,bitcoin_txid,
77+
msgdata,hsmd_setup_channel,funding_txout,u16,
78+
msgdata,hsmd_setup_channel,local_to_self_delay,u16,
79+
msgdata,hsmd_setup_channel,local_shutdown_script_len,u16,
80+
msgdata,hsmd_setup_channel,local_shutdown_script,u8,local_shutdown_script_len
81+
msgdata,hsmd_setup_channel,local_shutdown_wallet_index,?u32,
82+
msgdata,hsmd_setup_channel,remote_basepoints,basepoints,
83+
msgdata,hsmd_setup_channel,remote_funding_pubkey,pubkey,
84+
msgdata,hsmd_setup_channel,remote_to_self_delay,u16,
85+
msgdata,hsmd_setup_channel,remote_shutdown_script_len,u16,
86+
msgdata,hsmd_setup_channel,remote_shutdown_script,u8,remote_shutdown_script_len
87+
msgdata,hsmd_setup_channel,channel_type,channel_type,
8888

8989
# No value returned.
90-
msgtype,hsmd_ready_channel_reply,131
90+
msgtype,hsmd_setup_channel_reply,131
9191

9292
# Return signature for a funding tx.
9393
#include <common/utxo.h>

hsmd/libhsmd.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ bool hsmd_check_client_capabilities(struct hsmd_client *client,
9494

9595
case WIRE_HSMD_GET_PER_COMMITMENT_POINT:
9696
case WIRE_HSMD_CHECK_FUTURE_SECRET:
97-
case WIRE_HSMD_READY_CHANNEL:
97+
case WIRE_HSMD_SETUP_CHANNEL:
9898
return (client->capabilities & HSM_PERM_COMMITMENT_POINT) != 0;
9999

100100
case WIRE_HSMD_SIGN_REMOTE_COMMITMENT_TX:
@@ -143,7 +143,7 @@ bool hsmd_check_client_capabilities(struct hsmd_client *client,
143143
case WIRE_HSMD_CUPDATE_SIG_REPLY:
144144
case WIRE_HSMD_CLIENT_HSMFD_REPLY:
145145
case WIRE_HSMD_NEW_CHANNEL_REPLY:
146-
case WIRE_HSMD_READY_CHANNEL_REPLY:
146+
case WIRE_HSMD_SETUP_CHANNEL_REPLY:
147147
case WIRE_HSMD_NODE_ANNOUNCEMENT_SIG_REPLY:
148148
case WIRE_HSMD_SIGN_WITHDRAWAL_REPLY:
149149
case WIRE_HSMD_SIGN_INVOICE_REPLY:
@@ -337,7 +337,7 @@ static bool mem_is_zero(const void *mem, size_t len)
337337

338338
/* ~This stub implementation is overriden by fully validating signers
339339
* that need the unchanging channel parameters. */
340-
static u8 *handle_ready_channel(struct hsmd_client *c, const u8 *msg_in)
340+
static u8 *handle_setup_channel(struct hsmd_client *c, const u8 *msg_in)
341341
{
342342
bool is_outbound;
343343
struct amount_sat channel_value;
@@ -354,7 +354,7 @@ static u8 *handle_ready_channel(struct hsmd_client *c, const u8 *msg_in)
354354
struct amount_msat value_msat;
355355
struct channel_type *channel_type;
356356

357-
if (!fromwire_hsmd_ready_channel(tmpctx, msg_in, &is_outbound,
357+
if (!fromwire_hsmd_setup_channel(tmpctx, msg_in, &is_outbound,
358358
&channel_value, &push_value, &funding_txid,
359359
&funding_txout, &local_to_self_delay,
360360
&local_shutdown_script,
@@ -376,7 +376,7 @@ static u8 *handle_ready_channel(struct hsmd_client *c, const u8 *msg_in)
376376
assert(local_to_self_delay > 0);
377377
assert(remote_to_self_delay > 0);
378378

379-
return towire_hsmd_ready_channel_reply(NULL);
379+
return towire_hsmd_setup_channel_reply(NULL);
380380
}
381381

382382
/*~ For almost every wallet tx we use the BIP32 seed, but not for onchain
@@ -1904,8 +1904,8 @@ u8 *hsmd_handle_client_message(const tal_t *ctx, struct hsmd_client *client,
19041904

19051905
case WIRE_HSMD_NEW_CHANNEL:
19061906
return handle_new_channel(client, msg);
1907-
case WIRE_HSMD_READY_CHANNEL:
1908-
return handle_ready_channel(client, msg);
1907+
case WIRE_HSMD_SETUP_CHANNEL:
1908+
return handle_setup_channel(client, msg);
19091909
case WIRE_HSMD_GET_OUTPUT_SCRIPTPUBKEY:
19101910
return handle_get_output_scriptpubkey(client, msg);
19111911
case WIRE_HSMD_CHECK_FUTURE_SECRET:
@@ -1982,7 +1982,7 @@ u8 *hsmd_handle_client_message(const tal_t *ctx, struct hsmd_client *client,
19821982
case WIRE_HSMD_CUPDATE_SIG_REPLY:
19831983
case WIRE_HSMD_CLIENT_HSMFD_REPLY:
19841984
case WIRE_HSMD_NEW_CHANNEL_REPLY:
1985-
case WIRE_HSMD_READY_CHANNEL_REPLY:
1985+
case WIRE_HSMD_SETUP_CHANNEL_REPLY:
19861986
case WIRE_HSMD_NODE_ANNOUNCEMENT_SIG_REPLY:
19871987
case WIRE_HSMD_SIGN_WITHDRAWAL_REPLY:
19881988
case WIRE_HSMD_SIGN_INVOICE_REPLY:

openingd/dualopend.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ static u8 *accepter_commits(struct state *state,
19411941
"to msats");
19421942

19431943
/*~ Report the channel parameters to the signer. */
1944-
msg = towire_hsmd_ready_channel(NULL,
1944+
msg = towire_hsmd_setup_channel(NULL,
19451945
false, /* is_outbound */
19461946
total,
19471947
our_msats,
@@ -1957,8 +1957,8 @@ static u8 *accepter_commits(struct state *state,
19571957
state->channel_type);
19581958
wire_sync_write(HSM_FD, take(msg));
19591959
msg = wire_sync_read(tmpctx, HSM_FD);
1960-
if (!fromwire_hsmd_ready_channel_reply(msg))
1961-
status_failed(STATUS_FAIL_HSM_IO, "Bad ready_channel_reply %s",
1960+
if (!fromwire_hsmd_setup_channel_reply(msg))
1961+
status_failed(STATUS_FAIL_HSM_IO, "Bad setup_channel_reply %s",
19621962
tal_hex(tmpctx, msg));
19631963

19641964
tal_free(state->channel);
@@ -2675,7 +2675,7 @@ static u8 *opener_commits(struct state *state,
26752675
}
26762676

26772677
/*~ Report the channel parameters to the signer. */
2678-
msg = towire_hsmd_ready_channel(NULL,
2678+
msg = towire_hsmd_setup_channel(NULL,
26792679
true, /* is_outbound */
26802680
total,
26812681
their_msats,
@@ -2691,8 +2691,8 @@ static u8 *opener_commits(struct state *state,
26912691
state->channel_type);
26922692
wire_sync_write(HSM_FD, take(msg));
26932693
msg = wire_sync_read(tmpctx, HSM_FD);
2694-
if (!fromwire_hsmd_ready_channel_reply(msg))
2695-
status_failed(STATUS_FAIL_HSM_IO, "Bad ready_channel_reply %s",
2694+
if (!fromwire_hsmd_setup_channel_reply(msg))
2695+
status_failed(STATUS_FAIL_HSM_IO, "Bad setup_channel_reply %s",
26962696
tal_hex(tmpctx, msg));
26972697

26982698
tal_free(state->channel);

openingd/openingd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static bool funder_finalize_channel_setup(struct state *state,
632632
struct wally_tx_output *direct_outputs[NUM_SIDES];
633633

634634
/*~ Channel is ready; Report the channel parameters to the signer. */
635-
msg = towire_hsmd_ready_channel(NULL,
635+
msg = towire_hsmd_setup_channel(NULL,
636636
true, /* is_outbound */
637637
state->funding_sats,
638638
state->push_msat,
@@ -648,8 +648,8 @@ static bool funder_finalize_channel_setup(struct state *state,
648648
state->channel_type);
649649
wire_sync_write(HSM_FD, take(msg));
650650
msg = wire_sync_read(tmpctx, HSM_FD);
651-
if (!fromwire_hsmd_ready_channel_reply(msg))
652-
status_failed(STATUS_FAIL_HSM_IO, "Bad ready_channel_reply %s",
651+
if (!fromwire_hsmd_setup_channel_reply(msg))
652+
status_failed(STATUS_FAIL_HSM_IO, "Bad setup_channel_reply %s",
653653
tal_hex(tmpctx, msg));
654654

655655
/*~ Now we can initialize the `struct channel`. This represents
@@ -1222,7 +1222,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
12221222
}
12231223

12241224
/*~ Channel is ready; Report the channel parameters to the signer. */
1225-
msg = towire_hsmd_ready_channel(NULL,
1225+
msg = towire_hsmd_setup_channel(NULL,
12261226
false, /* is_outbound */
12271227
state->funding_sats,
12281228
state->push_msat,
@@ -1238,8 +1238,8 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
12381238
state->channel_type);
12391239
wire_sync_write(HSM_FD, take(msg));
12401240
msg = wire_sync_read(tmpctx, HSM_FD);
1241-
if (!fromwire_hsmd_ready_channel_reply(msg))
1242-
status_failed(STATUS_FAIL_HSM_IO, "Bad ready_channel_reply %s",
1241+
if (!fromwire_hsmd_setup_channel_reply(msg))
1242+
status_failed(STATUS_FAIL_HSM_IO, "Bad setup_channel_reply %s",
12431243
tal_hex(tmpctx, msg));
12441244

12451245
/* Now we can create the channel structure. */

0 commit comments

Comments
 (0)