diff --git a/node/peer-supervisor.go b/node/peer-supervisor.go index 76e329c..9a587e8 100644 --- a/node/peer-supervisor.go +++ b/node/peer-supervisor.go @@ -152,6 +152,9 @@ func (s *peerSupervisor) server() stateFunc { timeoutTimer = time.NewTimer(timeoutInterval) ) + // Timer will be restarted once we have established a connection. + timeoutTimer.Stop() + for { select { case peer := <-s.peerUpdates: @@ -161,6 +164,8 @@ func (s *peerSupervisor) server() stateFunc { switch p := pkt.Payload.(type) { case synPacket: + timeoutTimer.Reset(timeoutInterval) + // Before we can respond to this packet, we need to make sure the // route is setup properly. //