swarm: bootnode-mode, new bootnodes and no p2p package discovery (#18498)
(cherry picked from commit bbd120354a
)
This commit is contained in:
committed by
Rafael Matias
parent
878aa58ec6
commit
4976fcc91a
@ -423,3 +423,17 @@ func (p *Peer) Handshake(ctx context.Context, hs interface{}, verify func(interf
|
||||
}
|
||||
return rhs, nil
|
||||
}
|
||||
|
||||
// HasCap returns true if Peer has a capability
|
||||
// with provided name.
|
||||
func (p *Peer) HasCap(capName string) (yes bool) {
|
||||
if p == nil || p.Peer == nil {
|
||||
return false
|
||||
}
|
||||
for _, c := range p.Caps() {
|
||||
if c.Name == capName {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user