Skip to content

Commit

Permalink
Remove unused channel states
Browse files Browse the repository at this point in the history
  • Loading branch information
canndrew committed Dec 10, 2020
1 parent facad52 commit 74c33c9
Showing 1 changed file with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions src/DotNetLightning.Core/Channel/ChannelTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ type ChannelStatePhase =
| Opening
| Normal
| Closing
| Closed
| Abnormal
//| Closed
type ChannelState =
/// Establishing
| WaitForFundingConfirmed of WaitForFundingConfirmedData
Expand All @@ -329,16 +328,7 @@ type ChannelState =
| Shutdown of ShutdownData
| Negotiating of NegotiatingData
| Closing of ClosingData
| Closed of IChannelStateData

/// Abnormal
| Offline of IChannelStateData
| Syncing of IChannelStateData

/// Error
| ErrFundingLost of IChannelStateData
| ErrFundingTimeOut of IChannelStateData
| ErrInformationLeak of IChannelStateData
//| Closed of IChannelStateData
with
interface IState

Expand All @@ -357,12 +347,7 @@ type ChannelState =
| Shutdown data -> Some data.ChannelId
| Negotiating data -> Some data.ChannelId
| Closing data -> Some data.ChannelId
| Closed _
| Offline _
| Syncing _
| ErrFundingLost _
| ErrFundingTimeOut _
| ErrInformationLeak _ -> None
//| Closed _ -> None

member this.Phase =
match this with
Expand All @@ -372,12 +357,7 @@ type ChannelState =
| Shutdown _
| Negotiating _
| Closing _ -> ChannelStatePhase.Closing
| Closed _ -> ChannelStatePhase.Closed
| Offline _
| Syncing _
| ErrFundingLost _
| ErrFundingTimeOut _
| ErrInformationLeak _ -> Abnormal
//| Closed _ -> ChannelStatePhase.Closed

member this.Commitments: Option<Commitments> =
match this with
Expand All @@ -387,10 +367,5 @@ type ChannelState =
| Shutdown data -> Some (data :> IHasCommitments).Commitments
| Negotiating data -> Some (data :> IHasCommitments).Commitments
| Closing data -> Some (data :> IHasCommitments).Commitments
| Closed _
| Offline _
| Syncing _
| ErrFundingLost _
| ErrFundingTimeOut _
| ErrInformationLeak _ -> None
//| Closed _ -> None

0 comments on commit 74c33c9

Please sign in to comment.