htlcswitch: add test for deferred processing remote adds when quiescent

This commit is contained in:
Keagan McClelland committed 2024-11-26 13:52:54 -07:00
1 parent 4fbab45a5f
commit 5906ca2537
2 files changed
+99 -2

No files matched your search

+10 -2
View File
@@ -153,8 +153,10 @@ type mockServer struct {
t testing.TB
name string
messages chan lnwire.Message
name string
messages chan lnwire.Message
protocolTraceMtx sync.Mutex
protocolTrace []lnwire.Message
id [33]byte
htlcSwitch *Switch
@@ -289,6 +291,10 @@ func (s *mockServer) Start() error {
for {
select {
case msg := <-s.messages:
s.protocolTraceMtx.Lock()
s.protocolTrace = append(s.protocolTrace, msg)
s.protocolTraceMtx.Unlock()
var shouldSkip bool
for _, interceptor := range s.interceptorFuncs {
@@ -627,6 +633,8 @@ func (s *mockServer) readHandler(message lnwire.Message) error {
targetChan = msg.ChanID
case *lnwire.UpdateFee:
targetChan = msg.ChanID
case *lnwire.Stfu:
targetChan = msg.ChanID
default:
return fmt.Errorf("unknown message type: %T", msg)
}