dual-fund: keep track of aborted requests, seamlessly restart daemon

Clean restart of daemon after a tx-abort is a nice way to work around
the 'persistent' disconnect that we t-bast noticed.

Changelog-Fixed: `dualopend`: Fix behavior for tx-aborts. No longer hangs, appropriately continues re-init of RBF requests without reconnction msg exchange.
This commit is contained in:
niftynei
2023-07-29 20:41:26 -05:00
committed by Rusty Russell
parent c807db4b7f
commit 9b8909e507
21 changed files with 181 additions and 50 deletions

View File

@@ -42,6 +42,7 @@ peer_failed(struct per_peer_state *pps,
msg = towire_status_peer_error(NULL, channel_id,
desc,
warn,
false,
msg);
peer_billboard(true, desc);
peer_fatal_continue(take(msg), pps);
@@ -80,7 +81,8 @@ void peer_failed_err(struct per_peer_state *pps,
void peer_failed_received_errmsg(struct per_peer_state *pps,
const char *desc,
const struct channel_id *channel_id,
bool warning)
bool warning,
bool abort_restart)
{
u8 *msg;
@@ -94,7 +96,7 @@ void peer_failed_received_errmsg(struct per_peer_state *pps,
warning = true;
}
msg = towire_status_peer_error(NULL, channel_id, desc, warning,
NULL);
abort_restart, NULL);
peer_billboard(true, "Received %s", desc);
peer_fatal_continue(take(msg), pps);
}

View File

@@ -37,7 +37,8 @@ void peer_failed_err(struct per_peer_state *pps,
void peer_failed_received_errmsg(struct per_peer_state *pps,
const char *desc,
const struct channel_id *channel_id,
bool soft_error)
bool soft_error,
bool abort_restart)
NORETURN;
/* I/O error */

View File

@@ -8,5 +8,7 @@ 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,
# From an abort, no reconnect but restart daemon
msgdata,status_peer_error,abort_do_restart,bool,
msgdata,status_peer_error,len,u16,
msgdata,status_peer_error,error_for_them,u8,len
1 #include <common/channel_id.h>
8 # Take a deep breath, then try reconnecting to the precious little snowflake.
9 msgdata,status_peer_error,warning,bool,
10 msgdata,status_peer_error,len,u16, # From an abort, no reconnect but restart daemon
11 msgdata,status_peer_error,abort_do_restart,bool,
12 msgdata,status_peer_error,len,u16,
13 msgdata,status_peer_error,error_for_them,u8,len
14

View File

@@ -83,7 +83,7 @@ bool handle_peer_error(struct per_peer_state *pps,
}
/* We hang up when a warning is received. */
peer_failed_received_errmsg(pps, err, channel_id, warning);
peer_failed_received_errmsg(pps, err, channel_id, warning, false);
}
return false;

View File

@@ -94,7 +94,7 @@ char *sanitize_error(const tal_t *ctx, const u8 *errmsg,
else if (fromwire_warning(ctx, errmsg, channel_id, &data))
warning = true;
else if (fromwire_tx_abort(ctx, errmsg, channel_id, &data))
warning = false;
warning = true;
else
return tal_fmt(ctx, "Invalid ERROR message '%s'",
tal_hex(ctx, errmsg));