Skip to content

Commit

Permalink
Add testnet4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
zquestz committed Dec 20, 2024
1 parent 589a726 commit 3ba669d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit 3ba669d

Please sign in to comment.