all: simplify switches (#17267)
* all: simplify switches * silly mistake
This commit is contained in:
committed by
Péter Szilágyi
parent
273c7a9dc4
commit
d42ce0f2c1
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user