eth: don't wait for snap registration if we're not running snap (#22272)
Prevents a situation where we (not running snap) connects with a peer running snap, and get stalled waiting for snap registration to succeed (which will never happen), which cause a waitgroup wait to halt shutdown
This commit is contained in:
committed by
GitHub
parent
fba5a63afe
commit
7ed860d4f1
@ -73,7 +73,7 @@ func newPeerSet() *peerSet {
|
||||
func (ps *peerSet) registerSnapExtension(peer *snap.Peer) error {
|
||||
// Reject the peer if it advertises `snap` without `eth` as `snap` is only a
|
||||
// satellite protocol meaningful with the chain selection of `eth`
|
||||
if !peer.SupportsCap(eth.ProtocolName, eth.ProtocolVersions) {
|
||||
if !peer.RunningCap(eth.ProtocolName, eth.ProtocolVersions) {
|
||||
return errSnapWithoutEth
|
||||
}
|
||||
// Ensure nobody can double connect
|
||||
@ -101,7 +101,7 @@ func (ps *peerSet) registerSnapExtension(peer *snap.Peer) error {
|
||||
// by the peerset.
|
||||
func (ps *peerSet) waitSnapExtension(peer *eth.Peer) (*snap.Peer, error) {
|
||||
// If the peer does not support a compatible `snap`, don't wait
|
||||
if !peer.SupportsCap(snap.ProtocolName, snap.ProtocolVersions) {
|
||||
if !peer.RunningCap(snap.ProtocolName, snap.ProtocolVersions) {
|
||||
return nil, nil
|
||||
}
|
||||
// Ensure nobody can double connect
|
||||
|
Reference in New Issue
Block a user