aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-05-14 23:15:51 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-05-14 23:15:51 +0800
commit90b94e64fcdc6a2099ec5c48e41acf7f95a6b804 (patch)
treef8b7c0336f69aa3c66560a57dc9e172eb81418e8 /p2p/peer.go
parentff87c241a715833fa09cbed5e4acf0f1dfa9b745 (diff)
parentd2f119cf9b30a7568b5ebe7c290c3be30dc0f2de (diff)
downloaddexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.tar
dexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.tar.gz
dexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.tar.bz2
dexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.tar.lz
dexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.tar.xz
dexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.tar.zst
dexon-90b94e64fcdc6a2099ec5c48e41acf7f95a6b804.zip
Merge pull request #971 from fjl/p2p-limit-tweaks
p2p: tweak connection limits
Diffstat (limited to 'p2p/peer.go')
-rw-r--r--p2p/peer.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/p2p/peer.go b/p2p/peer.go
index ac691f2ce..c7ec08887 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -131,10 +131,11 @@ func (p *Peer) run() DiscReason {
case err := <-p.protoErr:
reason = discReasonForError(err)
case reason = <-p.disc:
+ p.politeDisconnect(reason)
+ reason = DiscRequested
}
close(p.closed)
- p.politeDisconnect(reason)
p.wg.Wait()
glog.V(logger.Debug).Infof("%v: Disconnected: %v\n", p, reason)
return reason
@@ -191,7 +192,7 @@ func (p *Peer) handle(msg Msg) error {
// check errors because, the connection will be closed after it.
rlp.Decode(msg.Payload, &reason)
glog.V(logger.Debug).Infof("%v: Disconnect Requested: %v\n", p, reason[0])
- return DiscRequested
+ return reason[0]
case msg.Code < baseProtocolLength:
// ignore other base protocol messages
return msg.Discard()