mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01:00
lnwallet+peer: add new ResetState method to channel state machine
In this commit, we add a new ResetState method to the channel state machine which will reset the state of the channel to `channelOpen`. We add this as before this commit, it was possible for a channel to shift into the closing state, the closing negotiation be cancelled for whatever reason, resulting the the channel held by the breachArbiter unable to act to potential on-chain events.
This commit is contained in:
@@ -1382,6 +1382,13 @@ func (lc *LightningChannel) CancelObserver() {
|
||||
close(lc.observerQuit)
|
||||
}
|
||||
|
||||
// ResetState resets the state of the channel back to the default state. This
|
||||
// ensures that any active goroutines which need to act based on on-chain
|
||||
// events do so properly.
|
||||
func (lc *LightningChannel) ResetState() {
|
||||
lc.Lock()
|
||||
lc.status = channelOpen
|
||||
lc.Unlock()
|
||||
}
|
||||
|
||||
// logUpdateToPayDesc converts a LogUpdate into a matching PaymentDescriptor
|
||||
|
||||
Reference in New Issue
Block a user