common: don't hang up when we receive a warning.
We were allowed to, but the spec removed that. So we handle warnings differently from errors now. This also means the LND "internal error" workaround is done in lightningd (we still disconnect, but we don't want to close channel). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: Protocol: we no longer disconnect every time we receive a warning message.
This commit is contained in:
@@ -116,15 +116,14 @@ static struct bitcoin_tx *close_tx(const tal_t *ctx,
|
||||
|
||||
/* Handle random messages we might get, returning the first non-handled one. */
|
||||
static u8 *closing_read_peer_msg(const tal_t *ctx,
|
||||
struct per_peer_state *pps,
|
||||
const struct channel_id *channel_id)
|
||||
struct per_peer_state *pps)
|
||||
{
|
||||
for (;;) {
|
||||
u8 *msg;
|
||||
|
||||
clean_tmpctx();
|
||||
msg = peer_read(ctx, pps);
|
||||
if (!handle_peer_error(pps, channel_id, msg))
|
||||
if (!handle_peer_error_or_warning(pps, msg))
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
@@ -255,7 +254,7 @@ receive_offer(struct per_peer_state *pps,
|
||||
|
||||
/* Wait for them to say something interesting */
|
||||
do {
|
||||
msg = closing_read_peer_msg(tmpctx, pps, channel_id);
|
||||
msg = closing_read_peer_msg(tmpctx, pps);
|
||||
|
||||
/* BOLT #2:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user