2018-02-19 02:06:14 +01:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H
|
2017-05-22 13:24:59 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2018-02-19 02:06:14 +01:00
|
|
|
/* These are in the database, so don't renumber them! */
|
|
|
|
enum channel_state {
|
2017-05-22 13:27:20 +02:00
|
|
|
/* In channeld, still waiting for lockin. */
|
2018-02-19 02:06:14 +01:00
|
|
|
CHANNELD_AWAITING_LOCKIN = 2,
|
2017-05-22 13:24:59 +02:00
|
|
|
|
|
|
|
/* Normal operating state. */
|
2017-05-22 13:27:20 +02:00
|
|
|
CHANNELD_NORMAL,
|
2017-05-22 13:24:59 +02:00
|
|
|
|
|
|
|
/* We are closing, pending HTLC resolution. */
|
2017-06-26 03:16:43 +02:00
|
|
|
CHANNELD_SHUTTING_DOWN,
|
2017-05-22 13:24:59 +02:00
|
|
|
|
|
|
|
/* Exchanging signatures on closing tx. */
|
2017-05-22 13:27:20 +02:00
|
|
|
CLOSINGD_SIGEXCHANGE,
|
2017-05-22 13:24:59 +02:00
|
|
|
|
2017-07-05 07:33:40 +02:00
|
|
|
/* Waiting for onchain event. */
|
|
|
|
CLOSINGD_COMPLETE,
|
|
|
|
|
2018-08-23 03:08:48 +02:00
|
|
|
/* Waiting for unilateral close to hit blockchain. */
|
|
|
|
AWAITING_UNILATERAL,
|
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
/* We've seen the funding spent, we're waiting for onchaind. */
|
|
|
|
FUNDING_SPEND_SEEN,
|
|
|
|
|
2018-02-23 07:23:51 +01:00
|
|
|
/* On chain */
|
2019-06-22 14:49:30 +02:00
|
|
|
ONCHAIN,
|
|
|
|
|
|
|
|
/* Final state after we have fully settled on-chain */
|
|
|
|
CLOSED
|
2017-05-22 13:24:59 +02:00
|
|
|
};
|
2019-06-22 14:49:30 +02:00
|
|
|
#define CHANNEL_STATE_MAX CLOSED
|
2017-05-22 13:24:59 +02:00
|
|
|
|
2018-02-19 02:06:14 +01:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H */
|