mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/pss: variable renamed, comment added
This commit is contained in:
parent
dd027ed666
commit
7cd148332e
1 changed files with 11 additions and 9 deletions
|
|
@ -947,20 +947,22 @@ func (p *Pss) forward(msg *PssMsg) error {
|
||||||
|
|
||||||
// proximity order function matching up to neighbourhoodDepth bits (po <= neighbourhoodDepth)
|
// proximity order function matching up to neighbourhoodDepth bits (po <= neighbourhoodDepth)
|
||||||
pof := pot.DefaultPof(neighbourhoodDepth)
|
pof := pot.DefaultPof(neighbourhoodDepth)
|
||||||
depth, _ := pof(to, p.BaseAddr(), 0)
|
|
||||||
if depth > luminosityRadius {
|
// soft threshold of msg propagation
|
||||||
depth = luminosityRadius
|
threshold, _ := pof(to, p.BaseAddr(), 0)
|
||||||
|
if threshold > luminosityRadius {
|
||||||
|
threshold = luminosityRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
// if measured from the recipient address (as opposed to the base address), then peers
|
// if measured from the recipient address as opposed to the base address (see Kademlia.EachConn
|
||||||
// that fall in the same proximity bin as recipient address will appear one bit closer
|
// call below), then peers that fall in the same proximity bin as recipient address will appear
|
||||||
// (at least), under condition that these additional bits exist in the recipient address.
|
// [at least] one bit closer, but only if these additional bits are given in the recipient address.
|
||||||
if depth < luminosityRadius && depth < neighbourhoodDepth {
|
if threshold < luminosityRadius && threshold < neighbourhoodDepth {
|
||||||
depth++
|
threshold++
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Kademlia.EachConn(to, addressLength*8, func(sp *network.Peer, po int, _ bool) bool {
|
p.Kademlia.EachConn(to, addressLength*8, func(sp *network.Peer, po int, _ bool) bool {
|
||||||
if po < depth && sent > 0 {
|
if po < threshold && sent > 0 {
|
||||||
return false // stop iterating
|
return false // stop iterating
|
||||||
}
|
}
|
||||||
if sendMessage(p, sp, msg) {
|
if sendMessage(p, sp, msg) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue