Expose ChannelDetails::channel_shutdown_state#827
Expose ChannelDetails::channel_shutdown_state#827f3r10 wants to merge 1 commit intolightningdevkit:mainfrom
ChannelDetails::channel_shutdown_state#827Conversation
Add a `ChannelShutdownState` enum mirroring LDK's own type, and expose it as an `Option<ChannelShutdownState>` field on `ChannelDetails`.
|
I've assigned @tnull as a reviewer! |
| pub config: ChannelConfig, | ||
| /// The current shutdown state of the channel, if any. | ||
| /// | ||
| /// Returns `None` for channels that have not yet started the shutdown process. |
There was a problem hiding this comment.
Could we replace this to accurately reflect what the source from the library says Returns None for ChannelDetails serialized on LDK versions prior to 0.0.116.
|
Thanks for looking into this. Could we add assertions for |
|
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
Summary
Closes #803.
We currently don't expose
ChannelDetails::channel_shutdown_state, so there is no good way for callers to tell whether a channel is actively going through a cooperative shutdown or merely has its peer temporarily disconnected — both situations causeis_usableto becomefalse.This PR adds:
ChannelShutdownStateenum (mirroring LDK's own type) with variantsNotShuttingDown,ShutdownInitiated,ResolvingHTLCs,NegotiatingClosingFee, andShutdownComplete.Option<ChannelShutdownState>field onChannelDetails, populated fromLdkChannelDetails::channel_shutdown_statevia the existingFromconversion.typedef enum ChannelShutdownStateentry in the UniFFI UDL so the field is available to Swift, Kotlin, and Python bindings.ChannelShutdownStatefrom the crate root.