OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
202f552
)
try to fix peer nil bug
author
paladz
<453256728@qq.com>
Sat, 21 Apr 2018 18:24:53 +0000
(
02:24
+0800)
committer
paladz
<453256728@qq.com>
Sat, 21 Apr 2018 18:24:53 +0000
(
02:24
+0800)
p2p/switch.go
patch
|
blob
|
history
diff --git
a/p2p/switch.go
b/p2p/switch.go
index
4ed18a5
..
f009929
100644
(file)
--- a/
p2p/switch.go
+++ b/
p2p/switch.go
@@
-480,11
+480,11
@@
func (sw *Switch) StopPeerGracefully(peer *Peer) {
}
func (sw *Switch) stopAndRemovePeer(peer *Peer, reason interface{}) {
- sw.peers.Remove(peer)
- peer.Stop()
for _, reactor := range sw.reactors {
reactor.RemovePeer(peer, reason)
}
+ sw.peers.Remove(peer)
+ peer.Stop()
}
func (sw *Switch) listenerRoutine(l Listener) {