aboutsummaryrefslogtreecommitdiffstats
path: root/server.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-18 00:14:59 +0800
committerobscuren <geffobscura@gmail.com>2014-01-18 00:14:59 +0800
commit87434a09418e6cc2dd4b92d7e35afc6f155994bc (patch)
tree76914e772618c2d31050ef63fbc3ea589a6a30d1 /server.go
parentddf82c333702e22d3cd7e5c693ad0603089a57a4 (diff)
downloadgo-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.tar
go-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.tar.gz
go-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.tar.bz2
go-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.tar.lz
go-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.tar.xz
go-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.tar.zst
go-tangerine-87434a09418e6cc2dd4b92d7e35afc6f155994bc.zip
Ping pong message
Diffstat (limited to 'server.go')
-rw-r--r--server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.go b/server.go
index f17cc32a0..9907f3b24 100644
--- a/server.go
+++ b/server.go
@@ -81,13 +81,13 @@ func (s *Server) Broadcast(msgType ethwire.MsgType, data []byte) {
}
const (
- processReapingTimeout = 10 // TODO increase
+ processReapingTimeout = 1 // TODO increase
)
func (s *Server) ReapDeadPeers() {
for {
eachPeer(s.peers, func(p *Peer, e *list.Element) {
- if atomic.LoadInt32(&p.disconnect) == 1 {
+ if atomic.LoadInt32(&p.disconnect) == 1 || (p.inbound && (time.Now().Unix()-p.lastPong) > int64(5*time.Minute)) {
log.Println("Dead peer found .. reaping")
s.peers.Remove(e)