swarm/network: Add comments

This commit is contained in:
lash 2018-12-21 08:56:51 +01:00
parent d45b0c4834
commit 412b02f416
2 changed files with 3 additions and 1 deletions

View file

@ -474,7 +474,7 @@ func depthForPot(p *pot.Pot, minProxBinSize int, pivotAddr []byte) (depth int) {
}
p.EachNeighbour(pivotAddr, Pof, f)
// the second step is to start from the top and test for empty bins
// the second step is to test for empty bins in order from shallowest to deepest
// if an empty bin is found, this will be the actual depth
// we stop iterating if we hit the maxDepth determined in the first step
p.EachBin(pivotAddr, Pof, 0, func(po int, _ int, f func(func(pot.Val, int) bool) bool) bool {

View file

@ -162,6 +162,8 @@ func TestNeighbourhoodDepth(t *testing.T) {
testNum++
}
// TestHealthStrict tests the simplest definition of health
// Which means whether we are connected to all neighbors we know of
func TestHealthStrict(t *testing.T) {
// base address is all zeros