diff --git a/crawler.go b/crawler.go index 977a342..2977e1a 100644 --- a/crawler.go +++ b/crawler.go @@ -46,7 +46,7 @@ func crawlIP(s *dnsseeder, r *result) ([]*wire.NetAddress, *crawlError) { onAddr := make(chan *wire.MsgAddr) peerCfg := &peer.Config{ UserAgentName: "dnsseeder", // User agent name to advertise. - UserAgentVersion: "1.0.1", // User agent version to advertise. + UserAgentVersion: "1.1.0", // User agent version to advertise. Services: 0, Listeners: peer.MessageListeners{ OnAddr: func(p *peer.Peer, msg *wire.MsgAddr) { @@ -68,10 +68,12 @@ func crawlIP(s *dnsseeder, r *result) ([]*wire.NetAddress, *crawlError) { }, }, } - // Assume testnet 3 if we are using a testnet port! - if s.port == 18333 { + switch s.id { + case 0xf4f3e5f4: peerCfg.ChainParams = &chaincfg.TestNet3Params - } else { + case 0xafdab7e2: + peerCfg.ChainParams = &chaincfg.TestNet4Params + default: peerCfg.ChainParams = &chaincfg.MainNetParams } p, err := peer.NewOutboundPeer(peerCfg, r.node)