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:
Wilmer Paulino 2023-10-24 16:54:20 -07:00
parent 9942994012
commit 9092c591f1
No known key found for this signature in database
GPG Key ID: 634FE5FC544DCA31

File diff suppressed because it is too large Load Diff