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
commit fc5a5830aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}