aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-24 18:29:58 +0800
committerobscuren <geffobscura@gmail.com>2014-12-24 18:29:58 +0800
commit7ba9fe4d5d46d4a9373327d52d1c0e82d5933bc1 (patch)
treee55eb2e0e63d3ded512f48e8ae41bf6d6cdaa39e
parent25d16f358ab5778ea04b23f60083b5a5325621c9 (diff)
downloadgo-tangerine-7ba9fe4d5d46d4a9373327d52d1c0e82d5933bc1.tar.gz
go-tangerine-7ba9fe4d5d46d4a9373327d52d1c0e82d5933bc1.tar.zst
go-tangerine-7ba9fe4d5d46d4a9373327d52d1c0e82d5933bc1.zip
Reset peer during download on disc
-rw-r--r--peer.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/peer.go b/peer.go
index 13f0239d4..ceb49a5af 100644
--- a/peer.go
+++ b/peer.go
@@ -412,6 +412,12 @@ func (p *Peer) HandleInbound() {
//}
case wire.MsgDiscTy:
+ blockPool := p.ethereum.blockPool
+ if blockPool.peer == p {
+ blockPool.peer = nil
+ blockPool.td = ethutil.Big0
+ }
+
p.Stop()
peerlogger.Infoln("Disconnect peer: ", DiscReason(msg.Data.Get(0).Uint()))
case wire.MsgPingTy: