mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-22 22:44:25 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user