diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-30 19:04:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-30 19:04:08 +0800 |
commit | f382221b28ab9e886263e37b1eab9c7924a6a0dc (patch) | |
tree | bfe979ce01e02438f6bb9cab8260f8954acc0147 /peer.go | |
parent | 6c91ffcfbe1a7b469dc6a8a2676959f0000c925a (diff) | |
download | dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.tar dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.tar.gz dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.tar.bz2 dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.tar.lz dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.tar.xz dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.tar.zst dexon-f382221b28ab9e886263e37b1eab9c7924a6a0dc.zip |
Broadcast "peerList" event upon removing or adding peers
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -2,7 +2,6 @@ package eth import ( "bytes" - "container/list" "fmt" "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethutil" @@ -523,13 +522,7 @@ func (p *Peer) Stop() { } // Pre-emptively remove the peer; don't wait for reaping. We already know it's dead if we are here - p.ethereum.peerMut.Lock() - defer p.ethereum.peerMut.Unlock() - eachPeer(p.ethereum.peers, func(peer *Peer, e *list.Element) { - if peer == p { - p.ethereum.peers.Remove(e) - } - }) + p.ethereum.RemovePeer(p) } func (p *Peer) pushHandshake() error { |