forked from cerc-io/plugeth
Reduce peer timeout to 10 seconds
This commit is contained in:
parent
a90ffe1af1
commit
22e16f15a6
3
peer.go
3
peer.go
@ -124,6 +124,7 @@ type Peer struct {
|
|||||||
port uint16
|
port uint16
|
||||||
caps Caps
|
caps Caps
|
||||||
|
|
||||||
|
// This peer's public key
|
||||||
pubkey []byte
|
pubkey []byte
|
||||||
|
|
||||||
// Indicated whether the node is catching up or not
|
// Indicated whether the node is catching up or not
|
||||||
@ -171,7 +172,7 @@ func NewOutboundPeer(addr string, ethereum *Ethereum, caps Caps) *Peer {
|
|||||||
|
|
||||||
// Set up the connection in another goroutine so we don't block the main thread
|
// Set up the connection in another goroutine so we don't block the main thread
|
||||||
go func() {
|
go func() {
|
||||||
conn, err := net.DialTimeout("tcp", addr, 30*time.Second)
|
conn, err := net.DialTimeout("tcp", addr, 10*time.Second)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ethutil.Config.Log.Debugln("Connection to peer failed", err)
|
ethutil.Config.Log.Debugln("Connection to peer failed", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user