swarm: bootnode-mode, new bootnodes and no p2p package discovery (#18498)

(cherry picked from commit bbd120354a)
This commit is contained in:
Anton Evangelatov
2019-01-24 12:02:18 +01:00
committed by Rafael Matias
parent 878aa58ec6
commit 4976fcc91a
16 changed files with 107 additions and 90 deletions

View File

@ -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
}