Skip to content

Commit

Permalink
lightningd: make close_txs parameter to resolve_close_command const.
Browse files Browse the repository at this point in the history
We don't need to change these txs.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Nov 25, 2024
1 parent 7063905 commit 1d05b25
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lightningd/closing_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct close_command {
/* Resolve a single close command. */
static void
resolve_one_close_command(struct close_command *cc, bool cooperative,
struct bitcoin_tx **close_txs)
const struct bitcoin_tx **close_txs)
{
assert(tal_count(close_txs));
struct json_stream *result = json_stream_success(cc->cmd);
Expand Down Expand Up @@ -107,7 +107,7 @@ const char *cmd_id_from_close_command(const tal_t *ctx,

/* Resolve a close command for a channel that will be closed soon. */
void resolve_close_command(struct lightningd *ld, struct channel *channel,
bool cooperative, struct bitcoin_tx **close_txs)
bool cooperative, const struct bitcoin_tx **close_txs)
{
struct close_command *cc;
struct close_command *n;
Expand Down
2 changes: 1 addition & 1 deletion lightningd/closing_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const char *cmd_id_from_close_command(const tal_t *ctx,

/* Resolve a close command for a channel that will be closed soon. */
void resolve_close_command(struct lightningd *ld, struct channel *channel,
bool cooperative, struct bitcoin_tx **close_txs);
bool cooperative, const struct bitcoin_tx **close_txs);

void peer_start_closingd(struct channel *channel,
struct peer_fd *peer_fd);
Expand Down
2 changes: 1 addition & 1 deletion lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void drop_to_chain(struct lightningd *ld, struct channel *channel,
"Not dropping our unilateral close onchain since "
"we already saw theirs confirm.");
} else {
struct bitcoin_tx **txs = tal_arr(tmpctx, struct bitcoin_tx*, 0);
const struct bitcoin_tx **txs = tal_arr(tmpctx, const struct bitcoin_tx*, 0);

/* We need to drop *every* commitment transaction to chain */
if (!cooperative && !list_empty(&channel->inflights)) {
Expand Down
2 changes: 1 addition & 1 deletion lightningd/test/run-invoice-select-inchan.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ void report_subd_memleak(struct leak_detect *leak_detect UNNEEDED, struct subd *
{ fprintf(stderr, "report_subd_memleak called!\n"); abort(); }
/* Generated stub for resolve_close_command */
void resolve_close_command(struct lightningd *ld UNNEEDED, struct channel *channel UNNEEDED,
bool cooperative UNNEEDED, struct bitcoin_tx **close_txs UNNEEDED)
bool cooperative UNNEEDED, const struct bitcoin_tx **close_txs UNNEEDED)
{ fprintf(stderr, "resolve_close_command called!\n"); abort(); }
/* Generated stub for send_backtrace */
void send_backtrace(const char *why UNNEEDED)
Expand Down
2 changes: 1 addition & 1 deletion wallet/test/run-wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void report_subd_memleak(struct leak_detect *leak_detect UNNEEDED, struct subd *
{ fprintf(stderr, "report_subd_memleak called!\n"); abort(); }
/* Generated stub for resolve_close_command */
void resolve_close_command(struct lightningd *ld UNNEEDED, struct channel *channel UNNEEDED,
bool cooperative UNNEEDED, struct bitcoin_tx **close_txs UNNEEDED)
bool cooperative UNNEEDED, const struct bitcoin_tx **close_txs UNNEEDED)
{ fprintf(stderr, "resolve_close_command called!\n"); abort(); }
/* Generated stub for rune_is_ours */
const char *rune_is_ours(struct lightningd *ld UNNEEDED, const struct rune *rune UNNEEDED)
Expand Down

0 comments on commit 1d05b25

Please sign in to comment.