lint: enable errcheck (#5336)

## Description

Enable errcheck linter throughout the codebase

Closes: #5059
This commit is contained in:
Marko
2020-09-07 17:03:18 +02:00
committed by GitHub
parent 3359e0bf2f
commit 0ed8dba991
39 changed files with 346 additions and 137 deletions

View File

@@ -214,7 +214,9 @@ func (pool *BlockPool) PopRequest() {
PanicSanity("PopRequest() requires a valid block")
}
*/
r.Stop()
if err := r.Stop(); err != nil {
pool.Logger.Error("Error stopping requester", "err", err)
}
delete(pool.requesters, pool.height)
pool.height++
} else {
@@ -615,7 +617,9 @@ OUTER_LOOP:
for {
select {
case <-bpr.pool.Quit():
bpr.Stop()
if err := bpr.Stop(); err != nil {
bpr.Logger.Error("Error stopped requester", "err", err)
}
return
case <-bpr.Quit():
return

View File

@@ -129,7 +129,9 @@ func (bcR *BlockchainReactor) SwitchToFastSync(state sm.State) error {
// OnStop implements service.Service.
func (bcR *BlockchainReactor) OnStop() {
if bcR.fastSync {
bcR.pool.Stop()
if err := bcR.pool.Stop(); err != nil {
bcR.Logger.Error("Error stopping pool", "err", err)
}
}
}
@@ -313,7 +315,9 @@ FOR_LOOP:
"outbound", outbound, "inbound", inbound)
if bcR.pool.IsCaughtUp() {
bcR.Logger.Info("Time to switch to consensus reactor!", "height", height)
bcR.pool.Stop()
if err := bcR.pool.Stop(); err != nil {
bcR.Logger.Error("Error stopping pool", "err", err)
}
conR, ok := bcR.Switch.Reactor("CONSENSUS").(consensusReactor)
if ok {
conR.SwitchToConsensus(state, blocksSynced > 0 || stateSynced)