p2p: fix switch test for Broadcast returning success channel

This commit is contained in:
Ethan Buchman
2015-03-18 12:42:11 -07:00
committed by Jae Kwon
parent 21530bf00f
commit a2938fd35b
2 changed files with 9 additions and 4 deletions

View File

@@ -166,7 +166,7 @@ func (sw *Switch) IsDialing(addr *NetAddress) bool {
// which receives success values for each attempted send (false if times out)
func (sw *Switch) Broadcast(chId byte, msg interface{}) chan bool {
if atomic.LoadUint32(&sw.stopped) == 1 {
return
return nil
}
successChan := make(chan bool, len(sw.peers.List()))
log.Debug("Broadcast", "channel", chId, "msg", msg)