diff options
author | Oleg Kovalov <iamolegkovalov@gmail.com> | 2018-07-30 17:30:09 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-07-30 17:30:09 +0800 |
commit | d42ce0f2c1b52e26cce475e411d97165fb975577 (patch) | |
tree | 03043c37becf49145b23f4824f563e3443335698 /eth/handler.go | |
parent | 273c7a9dc4e8961e96e51bd8274436ff983a21ef (diff) | |
download | go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.tar go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.tar.gz go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.tar.bz2 go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.tar.lz go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.tar.xz go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.tar.zst go-tangerine-d42ce0f2c1b52e26cce475e411d97165fb975577.zip |
all: simplify switches (#17267)
* all: simplify switches
* silly mistake
Diffstat (limited to 'eth/handler.go')
-rw-r--r-- | eth/handler.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/eth/handler.go b/eth/handler.go index f2d2eaf1c..f89f68c9d 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -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 } |