mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/network: Complete cut-off comments
This commit is contained in:
parent
2c2ec4f542
commit
0075f5eaea
1 changed files with 6 additions and 4 deletions
|
|
@ -631,7 +631,9 @@ func NewPeerPotMap(kadMinProxSize int, addrs [][]byte) map[string]*PeerPot {
|
||||||
// set to proxbin depth when all nn-peers are found
|
// set to proxbin depth when all nn-peers are found
|
||||||
pl := 256
|
pl := 256
|
||||||
|
|
||||||
// next po in turn in iteration
|
// upon entering a new iteration
|
||||||
|
// this will hold the value the po should be
|
||||||
|
// if it's one higher than the po in the last iteration
|
||||||
prev := 256
|
prev := 256
|
||||||
|
|
||||||
// all bins outside proxbin depth with no peers
|
// all bins outside proxbin depth with no peers
|
||||||
|
|
@ -646,7 +648,7 @@ func NewPeerPotMap(kadMinProxSize int, addrs [][]byte) map[string]*PeerPot {
|
||||||
np.EachNeighbour(addrs[i], pof, func(val pot.Val, po int) bool {
|
np.EachNeighbour(addrs[i], pof, func(val pot.Val, po int) bool {
|
||||||
a := val.([]byte)
|
a := val.([]byte)
|
||||||
|
|
||||||
// 256 is self. We don't care about ourselves
|
// 256 is self. We are selfless
|
||||||
if po == 256 {
|
if po == 256 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
@ -656,8 +658,8 @@ func NewPeerPotMap(kadMinProxSize int, addrs [][]byte) map[string]*PeerPot {
|
||||||
nns = append(nns, a)
|
nns = append(nns, a)
|
||||||
}
|
}
|
||||||
|
|
||||||
// all bins are filled
|
// if true then all nn-bins have been filled
|
||||||
// start counting pl and set prev to
|
// start counting pl and set prev to current po initially (which will skip next block)
|
||||||
if pl == 256 && len(nns) >= kadMinProxSize {
|
if pl == 256 && len(nns) >= kadMinProxSize {
|
||||||
pl = po
|
pl = po
|
||||||
prev = po
|
prev = po
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue