Skip to content

Commit 312965b

Browse files
committed
Refactor ChannelState to decouple state flags from states
Previously, our `ChannelState` contained bits for both states and flags. To make matters worse, some of the flags could apply to multiple states. This led to its API being very cumbersome, having to apply masks in most scenarios to check for certain states. As LDK grows and more features are added requiring more states/flags, the need for a simpler API arises. This refactor aims to improve this by decoupling the state flags from the `ChannelState` enum. Each state that requires flags will now have its own flags type, to ensure flags can only be applied to their intended state. All of this is done while maintaining backwards and forwards compatibility.
1 parent 74078c4 commit 312965b

File tree

1 file changed

+521
-270
lines changed

1 file changed

+521
-270
lines changed

0 commit comments

Comments
 (0)