mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-01-19 05:43:55 +01:00
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.
This commit is contained in:
parent
9942994012
commit
9092c591f1