mirror of
https://github.com/twisterarmy/dnsseeder.git
synced 2025-08-31 16:22:29 +00:00
change to NewMsgVersion
This commit is contained in:
parent
26829e0eec
commit
804c2062a4
10
crawler.go
10
crawler.go
@ -57,12 +57,10 @@ func crawlIP(s *dnsseeder, r *result) ([]*wire.NetAddress, *crawlError) {
|
||||
// set a deadline for all comms to be done by. After this all i/o will error
|
||||
conn.SetDeadline(time.Now().Add(time.Second * maxTo))
|
||||
|
||||
// First command to remote end needs to be a version command
|
||||
// last parameter is lastblock
|
||||
msgver, err := wire.NewMsgVersionFromConn(conn, nounce, 0)
|
||||
if err != nil {
|
||||
return nil, &crawlError{"Create NewMsgVersionFromConn", err}
|
||||
}
|
||||
meAddr, youAddr := conn.LocalAddr(), conn.RemoteAddr()
|
||||
me := wire.NewNetAddress(meAddr.(*net.TCPAddr), wire.SFNodeNetwork)
|
||||
you := wire.NewNetAddress(youAddr.(*net.TCPAddr), wire.SFNodeNetwork)
|
||||
msgver := wire.NewMsgVersion(me, you, nounce, 0)
|
||||
|
||||
err = wire.WriteMessage(conn, msgver, s.pver, s.id)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user