mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
htlcswitch: add test for deferred processing remote adds when quiescent
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user