1 #ifndef LIGHTNING_COMMON_HTLC_STATE_H
2 #define LIGHTNING_COMMON_HTLC_STATE_H
3 #include "config.h"
4 
5 /*
6  * /!\ The generated enum values are used in the database, DO NOT
7  * reorder or insert new values (appending at the end is ok) /!\
8  */
9 enum htlc_state {
10 	/* When we add a new htlc, it goes in this order. */
11 	SENT_ADD_HTLC,
12 	SENT_ADD_COMMIT,
13 	RCVD_ADD_REVOCATION,
14 	RCVD_ADD_ACK_COMMIT,
15 	SENT_ADD_ACK_REVOCATION,
16 
17 	/* When they remove an HTLC, it goes from SENT_ADD_ACK_REVOCATION: */
18 	RCVD_REMOVE_HTLC,
19 	RCVD_REMOVE_COMMIT,
20 	SENT_REMOVE_REVOCATION,
21 	SENT_REMOVE_ACK_COMMIT,
22 	RCVD_REMOVE_ACK_REVOCATION,
23 
24 	/* When they add a new htlc, it goes in this order. */
25 	RCVD_ADD_HTLC,
26 	RCVD_ADD_COMMIT,
27 	SENT_ADD_REVOCATION,
28 	SENT_ADD_ACK_COMMIT,
29 	RCVD_ADD_ACK_REVOCATION,
30 
31 	/* When we remove an HTLC, it goes from RCVD_ADD_ACK_REVOCATION: */
32 	SENT_REMOVE_HTLC,
33 	SENT_REMOVE_COMMIT,
34 	RCVD_REMOVE_REVOCATION,
35 	RCVD_REMOVE_ACK_COMMIT,
36 	SENT_REMOVE_ACK_REVOCATION,
37 
38 	HTLC_STATE_INVALID
39 };
40 #endif /* LIGHTNING_COMMON_HTLC_STATE_H */
41