core-lightning/channeld
Rusty Russell 36b1cac6e6 lightningd: new state AWAITING_UNILATERAL.
When in this state, we send a canned error "Awaiting unilateral close".
We enter this both when we drop to chain, and when we're trying to get
them to drop to chain due to option_data_loss_protect.

As this state (unlike channel errors) is saved to the database, it means
we will *never* talk to a peer again in this state, so they can't
confuse us.

Since we set this state in channel_fail_permanent() (which is the only
place we call drop_to_chain for a unilateral close), we don't need to
save to the db: channel_set_state() does that for us.

This state change has a subtle effect: we return WIRE_UNKNOWN_NEXT_PEER
instead of WIRE_TEMPORARY_CHANNEL_FAILURE as soon as we get a failure
with a peer.  To provoke a temporary failure in test_pay_disconnect we
take the node offline.

Reported-by: Christian Decker @cdecker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-08-23 14:46:22 +02:00
..
test Remove tal_len, use tal_count() or tal_bytelen(). 2018-07-30 11:31:17 +02:00
channel_wire.csv lightningd: message for channeld to tell us that channel risks penalty. 2018-08-23 14:46:22 +02:00
channel.c lightningd: new state AWAITING_UNILATERAL. 2018-08-23 14:46:22 +02:00
channeld_htlc.h channeld: always receive and maintain short_channel_id of failing channel. 2018-07-27 14:12:00 +02:00
commit_tx.c Remove dead stores 2018-07-31 12:45:02 +02:00
commit_tx.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00
full_channel_error.h channeld: map htlc add/remove errors to names. 2018-02-19 02:56:51 +00:00
full_channel.c Use snprintf(...) instead of sprintf(...) 2018-08-02 16:14:21 +09:30
full_channel.h channeld: make channel_fulfill_htlc return the HTLC it fulfulled. 2018-07-08 15:56:34 +02:00
Makefile channeld: send our own pings whenever we indicate we want to send a commitment. 2018-08-10 12:46:45 +02:00