@@ -1990,32 +1990,22 @@ func newDiscMsgStream(p *Brontide) *msgStream {
1990
1990
// so that a parent context can be passed in here.
1991
1991
ctx := context .TODO ()
1992
1992
1993
+ // Processing here means we send it to the gossiper which then
1994
+ // decides whether this message is processed immediately or
1995
+ // waits for dependent messages to be processed. It can also
1996
+ // happen that the message is not processed at all if it is
1997
+ // premature and the LRU cache fills up and the message is
1998
+ // deleted.
1993
1999
p .log .Debugf ("Processing remote msg %T" , msg )
1994
2000
1995
- errChan := p .cfg .AuthGossiper .ProcessRemoteAnnouncement (
1996
- ctx , msg , p ,
1997
- )
1998
-
1999
- // Start a goroutine to process the error channel for logging
2000
- // purposes.
2001
- //
2002
- // TODO(ziggie): Maybe use the error to potentially punish the
2003
- // peer depending on the error ?
2004
- go func () {
2005
- select {
2006
- case <- p .cg .Done ():
2007
- return
2008
-
2009
- case err := <- errChan :
2010
- if err != nil {
2011
- p .log .Warnf ("Error processing remote " +
2012
- "msg %T: %v" , msg ,
2013
- err )
2014
- }
2015
- }
2016
-
2017
- p .log .Debugf ("Processed remote msg %T" , msg )
2018
- }()
2001
+ // TODO(ziggie): ProcessRemoteAnnouncement returns an error
2002
+ // channel, but we cannot rely on it being written to.
2003
+ // Because some messages might never be processed (e.g.
2004
+ // premature channel updates). We should change the design here
2005
+ // and use the actor model pattern as soon as it is available.
2006
+ // So for now we should NOT use the error channel.
2007
+ // See https://github.com/lightningnetwork/lnd/pull/9820.
2008
+ p .cfg .AuthGossiper .ProcessRemoteAnnouncement (ctx , msg , p )
2019
2009
}
2020
2010
2021
2011
return newMsgStream (
0 commit comments