discovery: pass peer quit signal to ProcessQueryMsg
This commit passes the peer's quit signal to the gossipSyncer when attempt to hand off gossip query messages. This allows a rate-limited peer's read handler to break out immediately, which would otherwise remain stuck until the rate-limited gossip syncer pulled the message.
This commit is contained in:
parent
96c47f7de4
commit
ef309f43d2
@ -478,7 +478,7 @@ func (d *AuthenticatedGossiper) ProcessRemoteAnnouncement(msg lnwire.Message,
|
|||||||
|
|
||||||
// If we've found the message target, then we'll dispatch the
|
// If we've found the message target, then we'll dispatch the
|
||||||
// message directly to it.
|
// message directly to it.
|
||||||
syncer.ProcessQueryMsg(m)
|
syncer.ProcessQueryMsg(m, peer.QuitSignal())
|
||||||
|
|
||||||
errChan <- nil
|
errChan <- nil
|
||||||
return errChan
|
return errChan
|
||||||
|
@ -982,12 +982,11 @@ func (g *gossipSyncer) FilterGossipMsgs(msgs ...msgWithSenders) {
|
|||||||
|
|
||||||
// ProcessQueryMsg is used by outside callers to pass new channel time series
|
// ProcessQueryMsg is used by outside callers to pass new channel time series
|
||||||
// queries to the internal processing goroutine.
|
// queries to the internal processing goroutine.
|
||||||
func (g *gossipSyncer) ProcessQueryMsg(msg lnwire.Message) {
|
func (g *gossipSyncer) ProcessQueryMsg(msg lnwire.Message, peerQuit <-chan struct{}) {
|
||||||
select {
|
select {
|
||||||
case g.gossipMsgs <- msg:
|
case g.gossipMsgs <- msg:
|
||||||
return
|
case <-peerQuit:
|
||||||
case <-g.quit:
|
case <-g.quit:
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user