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>
This commit is contained in:
Christian Decker
2019-06-22 14:49:30 +02:00
committed by Rusty Russell
parent 7046d0220c
commit 1dbdc74bc3
3 changed files with 10 additions and 5 deletions

View File

@@ -26,8 +26,11 @@ enum channel_state {
FUNDING_SPEND_SEEN,
/* On chain */
ONCHAIN
ONCHAIN,
/* Final state after we have fully settled on-chain */
CLOSED
};
#define CHANNEL_STATE_MAX ONCHAIN
#define CHANNEL_STATE_MAX CLOSED
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_STATE_H */