mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
discovery/gossiper: exit early on validation barrier quit
This commit is contained in:
parent
27ca61aedf
commit
3854c1ed68
@ -906,13 +906,26 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||||||
// have thousands of goroutines active.
|
// have thousands of goroutines active.
|
||||||
validationBarrier.InitJobDependencies(announcement.msg)
|
validationBarrier.InitJobDependencies(announcement.msg)
|
||||||
|
|
||||||
|
d.wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
defer d.wg.Done()
|
||||||
defer validationBarrier.CompleteJob()
|
defer validationBarrier.CompleteJob()
|
||||||
|
|
||||||
// If this message has an existing dependency,
|
// If this message has an existing dependency,
|
||||||
// then we'll wait until that has been fully
|
// then we'll wait until that has been fully
|
||||||
// validated before we proceed.
|
// validated before we proceed.
|
||||||
validationBarrier.WaitForDependants(announcement.msg)
|
err := validationBarrier.WaitForDependants(
|
||||||
|
announcement.msg,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
if err != routing.ErrVBarrierShuttingDown {
|
||||||
|
log.Warnf("unexpected error "+
|
||||||
|
"during validation "+
|
||||||
|
"barrier shutdown: %v",
|
||||||
|
err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Process the network announcement to determine if
|
// Process the network announcement to determine if
|
||||||
// this is either a new announcement from our PoV
|
// this is either a new announcement from our PoV
|
||||||
|
Loading…
Reference in New Issue
Block a user