core-lightning/closingd/closing_wire.csv
Rusty Russell d2b4e09e27 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>
2018-04-23 20:18:15 +00:00

1.5 KiB

1#include <common/cryptomsg.h>
2#include <common/htlc_wire.h>
3# Begin! (passes peer fd, gossipd-client fd)
4closing_init,2001
5closing_init,,crypto_state,struct crypto_state
6closing_init,,gossip_index,u64
7closing_init,,seed,struct privkey
8closing_init,,funding_txid,struct bitcoin_txid
9closing_init,,funding_txout,u16
10closing_init,,funding_satoshi,u64
11closing_init,,remote_fundingkey,struct pubkey
12closing_init,,funder,enum side
13closing_init,,local_msatoshi,u64
14closing_init,,remote_msatoshi,u64
15closing_init,,our_dust_limit,u64
16closing_init,,min_fee_satoshi,u64
17closing_init,,fee_limit_satoshi,u64
18closing_init,,initial_fee_satoshi,u64
19closing_init,,local_scriptpubkey_len,u16
20closing_init,,local_scriptpubkey,local_scriptpubkey_len*u8
21closing_init,,remote_scriptpubkey_len,u16
22closing_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8
23closing_init,,reconnected,bool
24closing_init,,next_index_local,u64
25closing_init,,next_index_remote,u64
26closing_init,,revocations_received,u64
27# This means we allow closing negotiations out of bounds.
28closing_init,,deprecated_api,bool
29closing_init,,channel_reestablish_len,u16
30closing_init,,channel_reestablish,channel_reestablish_len*u8
31# We received an offer, save signature.
32closing_received_signature,2002
33closing_received_signature,,signature,secp256k1_ecdsa_signature
34closing_received_signature,,tx,struct bitcoin_tx
35closing_received_signature_reply,2102
36# Negotiations complete, we're exiting.
37closing_complete,2004
38closing_complete,,gossip_index,u64