Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Commit 412b02f

Browse files
committed
swarm/network: Add comments
1 parent d45b0c4 commit 412b02f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

swarm/network/kademlia.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ func depthForPot(p *pot.Pot, minProxBinSize int, pivotAddr []byte) (depth int) {
474474
}
475475
p.EachNeighbour(pivotAddr, Pof, f)
476476

477-
// the second step is to start from the top and test for empty bins
477+
// the second step is to test for empty bins in order from shallowest to deepest
478478
// if an empty bin is found, this will be the actual depth
479479
// we stop iterating if we hit the maxDepth determined in the first step
480480
p.EachBin(pivotAddr, Pof, 0, func(po int, _ int, f func(func(pot.Val, int) bool) bool) bool {

swarm/network/kademlia_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ func TestNeighbourhoodDepth(t *testing.T) {
162162
testNum++
163163
}
164164

165+
// TestHealthStrict tests the simplest definition of health
166+
// Which means whether we are connected to all neighbors we know of
165167
func TestHealthStrict(t *testing.T) {
166168

167169
// base address is all zeros

0 commit comments

Comments
 (0)