4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-07-13 12:56:29 +00:00

Merge pull request #203 from Arceliar/chord

Chord
This commit is contained in:
Neil Alexander
2018-11-14 20:13:42 +00:00
committed by GitHub
9 changed files with 261 additions and 517 deletions

View File

@ -229,12 +229,10 @@ func DEBUG_wire_encode_coords(coords []byte) []byte {
// DHT, via core
func (c *Core) DEBUG_getDHTSize() int {
total := 0
for bidx := 0; bidx < c.dht.nBuckets(); bidx++ {
b := c.dht.getBucket(bidx)
total += len(b.peers)
total += len(b.other)
}
var total int
c.router.doAdmin(func() {
total = len(c.dht.table)
})
return total
}