routing: return err on validation failure of network update
This ensures the waiting receiving channel always receives an error to prevent a deadlock when processing a network update that fails due to the validation barrier. On commit d5aedbcbd9db510c974c9f7be5ab177ad6546994: 1000 @ 0x43a285 0x44a38f 0xc42e86 0xc80fda 0xc8682d 0xc976c9 0x46fce1 github.com/lightningnetwork/lnd/routing.(*ChannelRouter).AddNode+0x245 github.com/lightningnetwork/lnd/routing/router.go:2218 github.com/lightningnetwork/lnd/discovery.(*AuthenticatedGossiper).addNode+0x3b9 github.com/lightningnetwork/lnd/discovery/gossiper.go:1510 github.com/lightningnetwork/lnd/discovery.(*AuthenticatedGossiper).processNetworkAnnouncement+0x574c github.com/lightningnetwork/lnd/discovery/gossiper.go:1554 github.com/lightningnetwork/lnd/discovery.(*AuthenticatedGossiper).networkHandler.func1+0x24github.com/lightningnetwork/lnd/discovery/gossiper.go:1043
This commit is contained in:
parent
2a2bc64a12
commit
eb4413154d
@ -1038,12 +1038,19 @@ func (r *ChannelRouter) networkHandler() {
|
|||||||
update.msg,
|
update.msg,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != ErrVBarrierShuttingDown &&
|
switch err {
|
||||||
err != ErrParentValidationFailed {
|
case ErrVBarrierShuttingDown:
|
||||||
|
update.err <- err
|
||||||
|
case ErrParentValidationFailed:
|
||||||
|
update.err <- newErrf(
|
||||||
|
ErrIgnored, err.Error(),
|
||||||
|
)
|
||||||
|
default:
|
||||||
log.Warnf("unexpected error "+
|
log.Warnf("unexpected error "+
|
||||||
"during validation "+
|
"during validation "+
|
||||||
"barrier shutdown: %v",
|
"barrier shutdown: %v",
|
||||||
err)
|
err)
|
||||||
|
update.err <- err
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user