htlcswitch: implement noop quiescer

In this commit we implement a noop quiescer that we will use when
the feature hasn't been negotiated. This will make it far easier to
manage quiescence operations without having a number of if statements
in the link logic.
This commit is contained in:
Keagan McClelland committed 2024-11-26 13:52:54 -07:00
1 parent 5906ca2537
commit 48ee643c0d
2 files changed
+102 -37

No files matched your search

+5 -3
View File
@@ -14,7 +14,7 @@ var cid = lnwire.ChannelID(bytes.Repeat([]byte{0x00}, 32))
type quiescerTestHarness struct {
pendingUpdates lntypes.Dual[uint64]
quiescer Quiescer
quiescer *QuiescerLive
conn <-chan lnwire.Stfu
}
@@ -27,14 +27,16 @@ func initQuiescerTestHarness(
conn: conn,
}
harness.quiescer = NewQuiescer(QuiescerCfg{
quiescer, _ := NewQuiescer(QuiescerCfg{
chanID: cid,
channelInitiator: channelInitiator,
sendMsg: func(msg lnwire.Stfu) error {
conn <- msg
return nil
},
})
}).(*QuiescerLive)
harness.quiescer = quiescer
return harness
}