htlcswitch: add link operation for initiating quiescence

This commit is contained in:
Keagan McClelland
2024-03-12 11:43:48 -07:00
parent a085b59814
commit 70e3804121
4 changed files with 45 additions and 0 deletions

View File

@@ -737,6 +737,22 @@ func (l *channelLink) OnCommitOnce(direction LinkDirection, hook func()) {
}
}
// InitStfu allows us to initiate quiescence on this link. It returns a receive
// only channel that will block until quiescence has been achieved, or
// definitively fails.
//
// This operation has been added to allow channels to be quiesced via RPC. It
// may be removed or reworked in the future as RPC initiated quiescence is a
// holdover until we have downstream protocols that use it.
func (l *channelLink) InitStfu() <-chan fn.Result[lntypes.ChannelParty] {
// TODO(proofofkeags): Implement
c := make(chan fn.Result[lntypes.ChannelParty], 1)
c <- fn.Errf[lntypes.ChannelParty]("InitStfu not yet implemented")
return c
}
// isReestablished returns true if the link has successfully completed the
// channel reestablishment dance.
func (l *channelLink) isReestablished() bool {