You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prefactor: Simplify state transitions, drop lock around PaymentQueue
The previous transition pattern of `OutboundJITChannelState` was never
great: we'd take `&mut self`, only to also return `Self` and required
updating the state externally to the state transtion methods. In
addition, we previously wrapped `PaymentQueue` in an `Arc<Mutex<..>>` to
avoid cloning them during state transtions.
Here, we clean up all of this, having the state transtion methods
updating the state in-place and merely returning an `action` in the
method's `Result`s. We also use `core::mem::take` to move the
`payment_queue` to the new states without reallocation.
0 commit comments