mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
d2b4e09e27
d822ba1ee
accidentally removed this case, which is important: if the
other side didn't get our final matching closing_signed, it will
reconnect and try again. We consider the channel no longer "active"
and thus ignore it, and get upset when it send the
`channel_reestablish` message.
We could just consider CLOSINGD_COMPLETE to be active, but then we'd
have to wait for the closing transaction to be mined before we'd allow
another connection.
We can't special case it when the peer reconnects, because there
could be (in theory) multiple channels for that peer in CLOSINGD_COMPLETE,
and we don't know which one to reestablish.
So, we need to catch this when they send the reestablish, and hand
that msg to closingd to do negotiation again. We already have code
to note that we're in CLOSINGD_COMPLETE and thus ignore any result
it gives us.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
17 lines
448 B
C
17 lines
448 B
C
#ifndef LIGHTNING_LIGHTNINGD_CLOSING_CONTROL_H
|
|
#define LIGHTNING_LIGHTNINGD_CLOSING_CONTROL_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
struct channel_id;
|
|
struct crypto_state;
|
|
|
|
void peer_start_closingd(struct channel *channel,
|
|
const struct crypto_state *cs,
|
|
u64 gossip_index,
|
|
int peer_fd, int gossip_fd,
|
|
bool reconnected,
|
|
const u8 *channel_reestablish);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CLOSING_CONTROL_H */
|