|
|
@ -25,6 +25,7 @@ var ( |
|
|
|
func init() { |
|
|
|
config = cfg.DefaultP2PConfig() |
|
|
|
config.PexReactor = true |
|
|
|
config.AllowDuplicateIP = true |
|
|
|
} |
|
|
|
|
|
|
|
type PeerMessage struct { |
|
|
@ -180,7 +181,7 @@ func TestConnAddrFilter(t *testing.T) { |
|
|
|
} |
|
|
|
|
|
|
|
func TestSwitchFiltersOutItself(t *testing.T) { |
|
|
|
s1 := MakeSwitch(config, 1, "127.0.0.2", "123.123.123", initSwitchFunc) |
|
|
|
s1 := MakeSwitch(config, 1, "127.0.0.1", "123.123.123", initSwitchFunc) |
|
|
|
// addr := s1.NodeInfo().NetAddress()
|
|
|
|
|
|
|
|
// // add ourselves like we do in node.go#427
|
|
|
@ -322,7 +323,7 @@ func TestSwitchReconnectsToPersistentPeer(t *testing.T) { |
|
|
|
Config: DefaultPeerConfig(), |
|
|
|
// Use different interface to prevent duplicate IP filter, this will break
|
|
|
|
// beyond two peers.
|
|
|
|
listenAddr: "127.0.0.2:0", |
|
|
|
listenAddr: "127.0.0.1:0", |
|
|
|
} |
|
|
|
rp.Start() |
|
|
|
defer rp.Stop() |
|
|
|