mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/network: remove stream cap check in kademlia On function
This commit is contained in:
parent
92c43bca9c
commit
160308b0df
1 changed files with 0 additions and 16 deletions
|
|
@ -283,22 +283,6 @@ func (k *Kademlia) SuggestPeer() (suggestedPeer *BzzAddr, saturationDepth int, c
|
||||||
func (k *Kademlia) On(p *Peer) (uint8, bool) {
|
func (k *Kademlia) On(p *Peer) (uint8, bool) {
|
||||||
k.lock.Lock()
|
k.lock.Lock()
|
||||||
defer k.lock.Unlock()
|
defer k.lock.Unlock()
|
||||||
|
|
||||||
caps := p.Caps()
|
|
||||||
|
|
||||||
var found bool
|
|
||||||
for _, c := range caps {
|
|
||||||
if c.Name == "stream" {
|
|
||||||
found = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !found {
|
|
||||||
depth := uint8(k.saturation())
|
|
||||||
return depth, false
|
|
||||||
}
|
|
||||||
|
|
||||||
var ins bool
|
var ins bool
|
||||||
k.conns, _, _, _ = pot.Swap(k.conns, p, Pof, func(v pot.Val) pot.Val {
|
k.conns, _, _, _ = pot.Swap(k.conns, p, Pof, func(v pot.Val) pot.Val {
|
||||||
// if not found live
|
// if not found live
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue