mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-25 06:42:13 +00:00
routing table should not have all the peers
This commit is contained in:
parent
a06b32768e
commit
b19ac720dd
@ -805,7 +805,7 @@ func TestEmptyTable(t *testing.T) {
|
|||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
nDHTs := 50 // needs more than 40 peers so we don't add all of them to our routing table.
|
nDHTs := 50
|
||||||
dhts := setupDHTS(t, ctx, nDHTs)
|
dhts := setupDHTS(t, ctx, nDHTs)
|
||||||
defer func() {
|
defer func() {
|
||||||
for _, dht := range dhts {
|
for _, dht := range dhts {
|
||||||
@ -837,6 +837,10 @@ func TestEmptyTable(t *testing.T) {
|
|||||||
oldSize = newSize
|
oldSize = newSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove any one peer from the RT so we don't end up disconnecting all of them if the RT
|
||||||
|
// already has all peers we are connected to
|
||||||
|
dhts[0].routingTable.Remove(dhts[0].routingTable.ListPeers()[0])
|
||||||
|
|
||||||
if u.Debug {
|
if u.Debug {
|
||||||
printRoutingTables(dhts[:1])
|
printRoutingTables(dhts[:1])
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user