From 08a7cd74da3f353b80ced16d1e2cf2d758606699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 19 Jul 2016 12:00:09 +0300 Subject: [PATCH] [release/1.4.11] eth: cancel DAO challenge on peer drop (annoying log) (cherry picked from commit 91f18ffd47d766b1493016da6802befbf9739709) --- eth/handler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eth/handler.go b/eth/handler.go index a498cd247a..6a648d2e0a 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -295,6 +295,13 @@ func (pm *ProtocolManager) handle(p *peer) error { glog.V(logger.Warn).Infof("%v: timed out DAO fork-check, dropping", p) pm.removePeer(p.id) }) + // Make sure it's cleaned up if the peer dies off + defer func() { + if p.forkDrop != nil { + p.forkDrop.Stop() + p.forkDrop = nil + } + }() } // main loop. handle incoming messages. for {