mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
common: don't send channel_id on peer error.
It's unused: they know what channel it is. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
aca2aa9ae6
commit
1bb83a1ae6
13 changed files with 9 additions and 23 deletions
|
@ -39,7 +39,7 @@ peer_failed(struct per_peer_state *pps,
|
|||
peer_write(pps, msg);
|
||||
|
||||
/* Tell master the error so it can re-xmit. */
|
||||
msg = towire_status_peer_error(NULL, channel_id,
|
||||
msg = towire_status_peer_error(NULL,
|
||||
desc,
|
||||
warn,
|
||||
false,
|
||||
|
@ -95,7 +95,7 @@ void peer_failed_received_errmsg(struct per_peer_state *pps,
|
|||
" let's give it some space");
|
||||
warning = true;
|
||||
}
|
||||
msg = towire_status_peer_error(NULL, channel_id, desc, warning,
|
||||
msg = towire_status_peer_error(NULL, desc, warning,
|
||||
abort_restart, NULL);
|
||||
peer_billboard(true, "Received %s", desc);
|
||||
peer_fatal_continue(take(msg), pps);
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
|
||||
# An error occurred: if error_for_them, that to go to them.
|
||||
msgtype,status_peer_error,0xFFF4
|
||||
# This is implied if error_for_them, but master tries not to parse packets.
|
||||
msgdata,status_peer_error,channel,channel_id,
|
||||
msgdata,status_peer_error,desc,wirestring,
|
||||
# Take a deep breath, then try reconnecting to the precious little snowflake.
|
||||
msgdata,status_peer_error,warning,bool,
|
||||
|
|
|
|
@ -3588,9 +3588,8 @@ AUTODATA(json_command, &openchannel_signed_command);
|
|||
AUTODATA(json_command, &openchannel_bump_command);
|
||||
AUTODATA(json_command, &openchannel_abort_command);
|
||||
|
||||
void static dualopen_errmsg(struct channel *channel,
|
||||
static void dualopen_errmsg(struct channel *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id UNUSED,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted,
|
||||
|
|
|
@ -1493,7 +1493,6 @@ static unsigned int onchain_msg(struct subd *sd, const u8 *msg, const int *fds U
|
|||
/* Only error onchaind can get is if it dies. */
|
||||
static void onchain_error(struct channel *channel,
|
||||
struct peer_fd *pps UNUSED,
|
||||
const struct channel_id *channel_id UNUSED,
|
||||
const char *desc,
|
||||
bool warning UNUSED,
|
||||
bool aborted UNUSED,
|
||||
|
|
|
@ -93,7 +93,6 @@ new_uncommitted_channel(struct peer *peer)
|
|||
|
||||
void opend_channel_errmsg(struct uncommitted_channel *uc,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id UNUSED,
|
||||
const char *desc,
|
||||
bool warning UNUSED,
|
||||
bool aborted UNUSED,
|
||||
|
|
|
@ -109,7 +109,6 @@ struct uncommitted_channel *new_uncommitted_channel(struct peer *peer);
|
|||
|
||||
void opend_channel_errmsg(struct uncommitted_channel *uc,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id UNUSED,
|
||||
const char *desc,
|
||||
bool warning UNUSED,
|
||||
bool aborted UNUSED,
|
||||
|
|
|
@ -375,7 +375,6 @@ void resend_closing_transactions(struct lightningd *ld)
|
|||
|
||||
void channel_errmsg(struct channel *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id UNUSED,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted UNUSED,
|
||||
|
|
|
@ -94,7 +94,6 @@ void peer_spoke(struct lightningd *ld, const u8 *msg);
|
|||
|
||||
void channel_errmsg(struct channel *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted,
|
||||
|
|
|
@ -420,7 +420,6 @@ static bool log_status_fail(struct subd *sd, const u8 *msg)
|
|||
static bool handle_peer_error(struct subd *sd, const u8 *msg, int fds[1])
|
||||
{
|
||||
void *channel = sd->channel;
|
||||
struct channel_id channel_id;
|
||||
char *desc;
|
||||
struct peer_fd *peer_fd;
|
||||
u8 *err_for_them;
|
||||
|
@ -428,7 +427,7 @@ static bool handle_peer_error(struct subd *sd, const u8 *msg, int fds[1])
|
|||
bool aborted;
|
||||
|
||||
if (!fromwire_status_peer_error(msg, msg,
|
||||
&channel_id, &desc, &warning,
|
||||
&desc, &warning,
|
||||
&aborted, &err_for_them))
|
||||
return false;
|
||||
|
||||
|
@ -436,7 +435,7 @@ static bool handle_peer_error(struct subd *sd, const u8 *msg, int fds[1])
|
|||
|
||||
/* Don't free sd; we may be about to free channel. */
|
||||
sd->channel = NULL;
|
||||
sd->errcb(channel, peer_fd, &channel_id, desc, warning, aborted, err_for_them);
|
||||
sd->errcb(channel, peer_fd, desc, warning, aborted, err_for_them);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -646,7 +645,7 @@ static void destroy_subd(struct subd *sd)
|
|||
if (!outer_transaction)
|
||||
db_begin_transaction(db);
|
||||
if (sd->errcb)
|
||||
sd->errcb(channel, NULL, NULL,
|
||||
sd->errcb(channel, NULL,
|
||||
tal_fmt(sd, "Owning subdaemon %s died (%i)",
|
||||
sd->name, status),
|
||||
false, false, NULL);
|
||||
|
@ -704,7 +703,6 @@ static struct subd *new_subd(const tal_t *ctx,
|
|||
const u8 *, const int *fds),
|
||||
void (*errcb)(void *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted,
|
||||
|
@ -815,7 +813,6 @@ struct subd *new_channel_subd_(const tal_t *ctx,
|
|||
const int *fds),
|
||||
void (*errcb)(void *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted,
|
||||
|
|
|
@ -51,7 +51,6 @@ struct subd {
|
|||
* error message we sent them if any. */
|
||||
void (*errcb)(void *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted,
|
||||
|
@ -134,7 +133,6 @@ struct subd *new_channel_subd_(const tal_t *ctx,
|
|||
const int *fds),
|
||||
void (*errcb)(void *channel,
|
||||
struct peer_fd *peer_fd,
|
||||
const struct channel_id *channel_id,
|
||||
const char *desc,
|
||||
bool warning,
|
||||
bool aborted,
|
||||
|
@ -152,7 +150,6 @@ struct subd *new_channel_subd_(const tal_t *ctx,
|
|||
typesafe_cb_postargs(void, void *, (errcb), \
|
||||
(channel), \
|
||||
struct peer_fd *, \
|
||||
const struct channel_id *, \
|
||||
const char *, bool, bool, const u8 *), \
|
||||
typesafe_cb_postargs(void, void *, (billboardcb), \
|
||||
(channel), bool, \
|
||||
|
|
|
@ -84,7 +84,7 @@ bool fromwire_status_fail(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, enu
|
|||
bool fromwire_status_peer_billboard(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, bool *perm UNNEEDED, wirestring **happenings UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_status_peer_billboard called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_status_peer_error */
|
||||
bool fromwire_status_peer_error(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct channel_id *channel UNNEEDED, wirestring **desc UNNEEDED, bool *warning UNNEEDED, bool *abort_do_restart UNNEEDED, u8 **error_for_them UNNEEDED)
|
||||
bool fromwire_status_peer_error(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, wirestring **desc UNNEEDED, bool *warning UNNEEDED, bool *abort_do_restart UNNEEDED, u8 **error_for_them UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_status_peer_error called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_status_version */
|
||||
bool fromwire_status_version(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, wirestring **version UNNEEDED)
|
||||
|
|
|
@ -70,7 +70,7 @@ bool fromwire_status_fail(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, enu
|
|||
bool fromwire_status_peer_billboard(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, bool *perm UNNEEDED, wirestring **happenings UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_status_peer_billboard called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_status_peer_error */
|
||||
bool fromwire_status_peer_error(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct channel_id *channel UNNEEDED, wirestring **desc UNNEEDED, bool *warning UNNEEDED, bool *abort_do_restart UNNEEDED, u8 **error_for_them UNNEEDED)
|
||||
bool fromwire_status_peer_error(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, wirestring **desc UNNEEDED, bool *warning UNNEEDED, bool *abort_do_restart UNNEEDED, u8 **error_for_them UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_status_peer_error called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_status_version */
|
||||
bool fromwire_status_version(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, wirestring **version UNNEEDED)
|
||||
|
|
|
@ -797,7 +797,7 @@ u8 *towire_gossipd_discovered_ip(const tal_t *ctx UNNEEDED, const struct wireadd
|
|||
u8 *towire_hsmd_check_pubkey(const tal_t *ctx UNNEEDED, u32 index UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
||||
{ fprintf(stderr, "towire_hsmd_check_pubkey called!\n"); abort(); }
|
||||
/* Generated stub for towire_hsmd_client_hsmfd */
|
||||
u8 *towire_hsmd_client_hsmfd(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED, u64 dbid UNNEEDED, u64 capabilities UNNEEDED)
|
||||
u8 *towire_hsmd_client_hsmfd(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED, u64 dbid UNNEEDED, u64 permissions UNNEEDED)
|
||||
{ fprintf(stderr, "towire_hsmd_client_hsmfd called!\n"); abort(); }
|
||||
/* Generated stub for towire_hsmd_derive_secret */
|
||||
u8 *towire_hsmd_derive_secret(const tal_t *ctx UNNEEDED, const u8 *info UNNEEDED)
|
||||
|
|
Loading…
Add table
Reference in a new issue