mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-30 11:14:20 +01:00
lightningd: re-allow closing negotiation when CLOSINGD_COMPLETE
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>
This commit is contained in:
@@ -333,10 +333,11 @@ bool peer_start_channeld(struct channel *channel UNNEEDED,
|
||||
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
|
||||
/* Generated stub for peer_start_closingd */
|
||||
void peer_start_closingd(struct channel *channel UNNEEDED,
|
||||
struct crypto_state *cs UNNEEDED,
|
||||
const struct crypto_state *cs UNNEEDED,
|
||||
u64 gossip_index UNNEEDED,
|
||||
int peer_fd UNNEEDED, int gossip_fd UNNEEDED,
|
||||
bool reconnected UNNEEDED)
|
||||
bool reconnected UNNEEDED,
|
||||
const u8 *channel_reestablish UNNEEDED)
|
||||
{ fprintf(stderr, "peer_start_closingd called!\n"); abort(); }
|
||||
/* Generated stub for sanitize_error */
|
||||
char *sanitize_error(const tal_t *ctx UNNEEDED, const u8 *errmsg UNNEEDED,
|
||||
|
||||
Reference in New Issue
Block a user