|
|
@ -76,13 +76,12 @@ func TestNetworkID(t *testing.T) { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
t.Fatalf("Error setting up network: %v", err) |
|
|
|
t.Fatalf("Error setting up network: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
defer func() { |
|
|
|
|
|
|
|
//shutdown the snapshot network
|
|
|
|
|
|
|
|
log.Trace("Shutting down network") |
|
|
|
|
|
|
|
net.Shutdown() |
|
|
|
|
|
|
|
}() |
|
|
|
|
|
|
|
//let's sleep to ensure all nodes are connected
|
|
|
|
//let's sleep to ensure all nodes are connected
|
|
|
|
time.Sleep(1 * time.Second) |
|
|
|
time.Sleep(1 * time.Second) |
|
|
|
|
|
|
|
// shutdown the the network to avoid race conditions
|
|
|
|
|
|
|
|
// on accessing kademlias global map while network nodes
|
|
|
|
|
|
|
|
// are accepting messages
|
|
|
|
|
|
|
|
net.Shutdown() |
|
|
|
//for each group sharing the same network ID...
|
|
|
|
//for each group sharing the same network ID...
|
|
|
|
for _, netIDGroup := range nodeMap { |
|
|
|
for _, netIDGroup := range nodeMap { |
|
|
|
log.Trace("netIDGroup size", "size", len(netIDGroup)) |
|
|
|
log.Trace("netIDGroup size", "size", len(netIDGroup)) |
|
|
|