Skip to content

Commit

Permalink
Merge pull request #1910 from get10101/fix/channel-status
Browse files Browse the repository at this point in the history
Map `SignedChannelState`  to `ChannelStatus` correctly
  • Loading branch information
luckysori authored Jan 29, 2024
2 parents 54d8fcb + 5769525 commit 8dcde95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions mobile/native/src/ln_dlc/channel_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,15 @@ impl From<Option<&SignedChannel>> for ChannelStatus {
None => Self::NotOpen,
Some(channel) => match channel.state {
SignedChannelState::Established { .. } => Self::WithPosition,
SignedChannelState::Settled { .. } | SignedChannelState::RenewFinalized { .. } => {
Self::Open
}
SignedChannelState::Settled { .. } => Self::Open,
SignedChannelState::SettledOffered { .. }
| SignedChannelState::SettledReceived { .. }
| SignedChannelState::SettledAccepted { .. }
| SignedChannelState::SettledConfirmed { .. } => Self::Settling,
SignedChannelState::RenewOffered { .. }
| SignedChannelState::RenewAccepted { .. }
| SignedChannelState::RenewConfirmed { .. } => Self::Renewing,
| SignedChannelState::RenewConfirmed { .. }
| SignedChannelState::RenewFinalized { .. } => Self::Renewing,
SignedChannelState::Closing { .. }
| SignedChannelState::CollaborativeCloseOffered { .. } => Self::Closing,
},
Expand Down

0 comments on commit 8dcde95

Please sign in to comment.