|
|
@ -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
|
|
|
|
// 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)) |
|
|
|
conn.SetDeadline(time.Now().Add(time.Second * maxTo)) |
|
|
|
|
|
|
|
|
|
|
|
// First command to remote end needs to be a version command
|
|
|
|
meAddr, youAddr := conn.LocalAddr(), conn.RemoteAddr() |
|
|
|
// last parameter is lastblock
|
|
|
|
me := wire.NewNetAddress(meAddr.(*net.TCPAddr), wire.SFNodeNetwork) |
|
|
|
msgver, err := wire.NewMsgVersionFromConn(conn, nounce, 0) |
|
|
|
you := wire.NewNetAddress(youAddr.(*net.TCPAddr), wire.SFNodeNetwork) |
|
|
|
if err != nil { |
|
|
|
msgver := wire.NewMsgVersion(me, you, nounce, 0) |
|
|
|
return nil, &crawlError{"Create NewMsgVersionFromConn", err} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = wire.WriteMessage(conn, msgver, s.pver, s.id) |
|
|
|
err = wire.WriteMessage(conn, msgver, s.pver, s.id) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|