diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-05-07 14:16:41 +0800 |
---|---|---|
committer | Mission Liao <mission.liao@dexon.org> | 2019-05-07 15:09:40 +0800 |
commit | d5057f8ccd2cb733cf541d213de50334ec859cfd (patch) | |
tree | c82e614c6b1c45028792cf7057b6cd4c29d48435 | |
parent | 45976143c39aa8f4856aec2b098620a1adc7177c (diff) | |
download | dexon-d5057f8ccd2cb733cf541d213de50334ec859cfd.tar.gz dexon-d5057f8ccd2cb733cf541d213de50334ec859cfd.tar.zst dexon-d5057f8ccd2cb733cf541d213de50334ec859cfd.zip |
Fix lint error: should use for range
-rw-r--r-- | dex/consensus/core/syncer/agreement.go | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/dex/consensus/core/syncer/agreement.go b/dex/consensus/core/syncer/agreement.go index 417bcb9f1..b7b77057f 100644 --- a/dex/consensus/core/syncer/agreement.go +++ b/dex/consensus/core/syncer/agreement.go @@ -79,25 +79,18 @@ func newAgreement(chainTip uint64, // routine explicitly in the caller. func (a *agreement) run() { defer a.ctxCancel() - for { - select { - case val, ok := <-a.inputChan: - if !ok { - // InputChan is closed by network when network ends. - return - } - switch v := val.(type) { - case *types.Block: - if v.Position.Round >= core.DKGDelayRound && v.IsFinalized() { - a.processFinalizedBlock(v) - } else { - a.processBlock(v) - } - case *types.AgreementResult: - a.processAgreementResult(v) - case uint64: - a.processNewCRS(v) + for val := range a.inputChan { + switch v := val.(type) { + case *types.Block: + if v.Position.Round >= core.DKGDelayRound && v.IsFinalized() { + a.processFinalizedBlock(v) + } else { + a.processBlock(v) } + case *types.AgreementResult: + a.processAgreementResult(v) + case uint64: + a.processNewCRS(v) } } } |