all: simplify switches (#17267)

* all: simplify switches

* silly mistake
This commit is contained in:
Oleg Kovalov
2018-07-30 11:30:09 +02:00
committed by Péter Szilágyi
parent 273c7a9dc4
commit d42ce0f2c1
10 changed files with 20 additions and 34 deletions

View File

@ -744,8 +744,7 @@ func (pm *ProtocolManager) BroadcastTxs(txs types.Transactions) {
func (pm *ProtocolManager) minedBroadcastLoop() {
// automatically stops if unsubscribe
for obj := range pm.minedBlockSub.Chan() {
switch ev := obj.Data.(type) {
case core.NewMinedBlockEvent:
if ev, ok := obj.Data.(core.NewMinedBlockEvent); ok {
pm.BroadcastBlock(ev.Block, true) // First propagate block to peers
pm.BroadcastBlock(ev.Block, false) // Only then announce to the rest
}