Skip to content

Commit

Permalink
lightningd: remove duplicate routine fail_transient_delayreconnect
Browse files Browse the repository at this point in the history
Code is identical to `channel_fail_transient`
  • Loading branch information
niftynei authored and vincenzopalazzo committed Feb 5, 2023
1 parent b375a35 commit 96b3b40
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
9 changes: 0 additions & 9 deletions lightningd/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,6 @@ static void channel_err(struct channel *channel, const char *why)
channel_set_owner(channel, NULL);
}

void channel_fail_transient_delayreconnect(struct channel *channel, const char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);
channel_err(channel, tal_vfmt(tmpctx, fmt, ap));
va_end(ap);
}

void channel_fail_transient(struct channel *channel, const char *fmt, ...)
{
va_list ap;
Expand Down
3 changes: 0 additions & 3 deletions lightningd/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,6 @@ void channel_set_owner(struct channel *channel, struct subd *owner);
/* Channel has failed, but can try again. */
void channel_fail_transient(struct channel *channel,
const char *fmt, ...) PRINTF_FMT(2,3);
/* Channel has failed, but can try again after a minute. */
void channel_fail_transient_delayreconnect(struct channel *channel,
const char *fmt,...) PRINTF_FMT(2,3);

/* Channel has failed, give up on it. */
void channel_fail_permanent(struct channel *channel,
Expand Down
6 changes: 3 additions & 3 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ void channel_errmsg(struct channel *channel,
* and we would close the channel on them. We now support warnings
* for this case. */
if (warning) {
channel_fail_transient_delayreconnect(channel, "%s WARNING: %s",
channel->owner->name, desc);
channel_fail_transient(channel, "%s WARNING: %s",
channel->owner->name, desc);
return;
}

Expand Down Expand Up @@ -1836,7 +1836,7 @@ static enum watch_result funding_depth_cb(struct lightningd *ld,
warning)));
/* When we restart channeld, it will be initialized with updated scid
* and also adds it (at least our halve_chan) to rtable. */
channel_fail_transient_delayreconnect(channel,
channel_fail_transient(channel,
"short_channel_id changed to %s (was %s)",
short_channel_id_to_str(tmpctx, &scid),
short_channel_id_to_str(tmpctx, channel->scid));
Expand Down
4 changes: 0 additions & 4 deletions lightningd/test/run-invoice-select-inchan.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ void channel_fail_permanent(struct channel *channel UNNEEDED,
void channel_fail_transient(struct channel *channel UNNEEDED,
const char *fmt UNNEEDED, ...)
{ fprintf(stderr, "channel_fail_transient called!\n"); abort(); }
/* Generated stub for channel_fail_transient_delayreconnect */
void channel_fail_transient_delayreconnect(struct channel *channel UNNEEDED,
const char *fmt UNNEEDED,...)
{ fprintf(stderr, "channel_fail_transient_delayreconnect called!\n"); abort(); }
/* Generated stub for channel_has_htlc_in */
struct htlc_in *channel_has_htlc_in(struct channel *channel UNNEEDED)
{ fprintf(stderr, "channel_has_htlc_in called!\n"); abort(); }
Expand Down

0 comments on commit 96b3b40

Please sign in to comment.