2017-08-28 18:06:01 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_HTLC_STATE_H
|
|
|
|
#define LIGHTNING_COMMON_HTLC_STATE_H
|
2016-08-18 06:53:45 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2017-09-01 15:54:41 +02:00
|
|
|
/*
|
|
|
|
* /!\ The generated enum values are used in the database, DO NOT
|
|
|
|
* reorder or insert new values (appending at the end is ok) /!\
|
|
|
|
*/
|
2016-08-18 06:53:45 +02:00
|
|
|
enum htlc_state {
|
|
|
|
/* When we add a new htlc, it goes in this order. */
|
|
|
|
SENT_ADD_HTLC,
|
|
|
|
SENT_ADD_COMMIT,
|
|
|
|
RCVD_ADD_REVOCATION,
|
|
|
|
RCVD_ADD_ACK_COMMIT,
|
|
|
|
SENT_ADD_ACK_REVOCATION,
|
|
|
|
|
2018-02-08 22:43:01 +01:00
|
|
|
/* When they remove an HTLC, it goes from SENT_ADD_ACK_REVOCATION: */
|
2016-08-18 06:53:45 +02:00
|
|
|
RCVD_REMOVE_HTLC,
|
|
|
|
RCVD_REMOVE_COMMIT,
|
|
|
|
SENT_REMOVE_REVOCATION,
|
|
|
|
SENT_REMOVE_ACK_COMMIT,
|
|
|
|
RCVD_REMOVE_ACK_REVOCATION,
|
|
|
|
|
|
|
|
/* When they add a new htlc, it goes in this order. */
|
|
|
|
RCVD_ADD_HTLC,
|
|
|
|
RCVD_ADD_COMMIT,
|
|
|
|
SENT_ADD_REVOCATION,
|
|
|
|
SENT_ADD_ACK_COMMIT,
|
|
|
|
RCVD_ADD_ACK_REVOCATION,
|
|
|
|
|
2018-02-08 22:43:01 +01:00
|
|
|
/* When we remove an HTLC, it goes from RCVD_ADD_ACK_REVOCATION: */
|
2016-08-18 06:53:45 +02:00
|
|
|
SENT_REMOVE_HTLC,
|
|
|
|
SENT_REMOVE_COMMIT,
|
|
|
|
RCVD_REMOVE_REVOCATION,
|
|
|
|
RCVD_REMOVE_ACK_COMMIT,
|
2016-08-18 06:55:13 +02:00
|
|
|
SENT_REMOVE_ACK_REVOCATION,
|
|
|
|
|
|
|
|
HTLC_STATE_INVALID
|
2016-08-18 06:53:45 +02:00
|
|
|
};
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_HTLC_STATE_H */
|