add missing htlc states from incoming htlcs

This commit is contained in:
daywalker90 2023-05-14 19:02:55 +02:00 committed by Christian Decker
parent 0850cbb5bb
commit 0ea7cb2484
2 changed files with 28 additions and 0 deletions

View File

@ -50,6 +50,15 @@ enum HtlcState {
SentRemoveRevocation = 8;
SentRemoveAckCommit = 9;
RcvdRemoveAckRevocation = 10;
RCVD_ADD_HTLC = 11,
RCVD_ADD_COMMIT = 12,
SENT_ADD_REVOCATION = 13,
SENT_ADD_ACK_COMMIT = 14,
SENT_REMOVE_HTLC = 15,
SENT_REMOVE_COMMIT = 16,
RCVD_REMOVE_REVOCATION = 17,
RCVD_REMOVE_ACK_COMMIT = 18,
SENT_REMOVE_ACK_REVOCATION = 19,
}
message ChannelStateChangeCause {}

View File

@ -40,6 +40,15 @@ pub enum HtlcState {
SENT_REMOVE_REVOCATION = 8,
SENT_REMOVE_ACK_COMMIT = 9,
RCVD_REMOVE_ACK_REVOCATION = 10,
RCVD_ADD_HTLC = 11,
RCVD_ADD_COMMIT = 12,
SENT_ADD_REVOCATION = 13,
SENT_ADD_ACK_COMMIT = 14,
SENT_REMOVE_HTLC = 15,
SENT_REMOVE_COMMIT = 16,
RCVD_REMOVE_REVOCATION = 17,
RCVD_REMOVE_ACK_COMMIT = 18,
SENT_REMOVE_ACK_REVOCATION = 19,
}
#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
@ -319,6 +328,16 @@ impl From<i32> for HtlcState {
8 => HtlcState::SENT_REMOVE_REVOCATION,
9 => HtlcState::SENT_REMOVE_ACK_COMMIT,
10 => HtlcState::RCVD_REMOVE_ACK_REVOCATION,
11 => HtlcState::RCVD_ADD_HTLC,
12 => HtlcState::RCVD_ADD_COMMIT,
13 => HtlcState::SENT_ADD_REVOCATION,
14 => HtlcState::SENT_ADD_ACK_COMMIT,
15 => HtlcState::SENT_REMOVE_HTLC,
16 => HtlcState::SENT_REMOVE_COMMIT,
17 => HtlcState::RCVD_REMOVE_REVOCATION,
18 => HtlcState::RCVD_REMOVE_ACK_COMMIT,
19 => HtlcState::SENT_REMOVE_ACK_REVOCATION,
n => panic!("Unmapped HtlcState variant: {}", n),
}
}