core-lightning/lightningd/channel_state.h
Christian Decker 1dbdc74bc3 wallet: Add a final CLOSED state to channels
Instead of deleting the channels we will simple mark them as `CLOSED` from now
on. This is needed for some of the other tables not to end up with dangling
references that would otherwise survive the channel lifetime, e.g., forwards
and transactions.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-06-30 16:41:30 +09:30

37 lines
857 B
C

#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H
#define LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H
#include "config.h"
/* These are in the database, so don't renumber them! */
enum channel_state {
/* In channeld, still waiting for lockin. */
CHANNELD_AWAITING_LOCKIN = 2,
/* Normal operating state. */
CHANNELD_NORMAL,
/* We are closing, pending HTLC resolution. */
CHANNELD_SHUTTING_DOWN,
/* Exchanging signatures on closing tx. */
CLOSINGD_SIGEXCHANGE,
/* Waiting for onchain event. */
CLOSINGD_COMPLETE,
/* Waiting for unilateral close to hit blockchain. */
AWAITING_UNILATERAL,
/* We've seen the funding spent, we're waiting for onchaind. */
FUNDING_SPEND_SEEN,
/* On chain */
ONCHAIN,
/* Final state after we have fully settled on-chain */
CLOSED
};
#define CHANNEL_STATE_MAX CLOSED
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H */