htlcswitch: implement flush and commit lifecycle hooks for channelLink

This commit is contained in:
Keagan McClelland committed 2024-01-22 16:08:55 -08:00
1 parent 601afaf1b2
commit 64fda6ca65
4 files changed
+236 -41

No files matched your search

+11
View File
@@ -5466,6 +5466,17 @@ func (lc *LightningChannel) OweCommitment() bool {
return lc.oweCommitment(true)
}
// NeedCommitment returns a boolean value reflecting whether we are waiting on
// a commitment signature because there are outstanding remote updates and/or
// updates in the remote commit tx that aren't reflected in the local commit tx
// yet.
func (lc *LightningChannel) NeedCommitment() bool {
lc.RLock()
defer lc.RUnlock()
return lc.oweCommitment(false)
}
// oweCommitment is the internal version of OweCommitment. This function expects
// to be executed with a lock held.
func (lc *LightningChannel) oweCommitment(local bool) bool {