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
2024-08-09 20:25:44 -07:00
parent 5906ca2537
commit 48ee643c0d
2 changed files with 102 additions and 37 deletions

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
}