rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

LSPS2: Isolate `PeerState` types via a `sealed` sub-module

Open tnull opened this issue 4 months ago • 0 comments

The LSPS2 service handler has a lot going on. In particular, it might currently is hard to follow when we actually make a state change that needs to be persisted.

We should isolate the PeerState and related types to a sealed sub-module to ensure we can only access/modify it via dedicated internal pub API methods. This would reduce the number of places where we need to set needs_persist, making it much less error prone.

FWIW, I started down this road as part of #4008, but this would be huge refactor on its own right so decided not to continue for the time being.

tnull avatar Sep 16 '25 12:09 tnull