linting: apply errcheck part2

This commit is contained in:
Zach Ramsay
2017-09-06 13:11:47 -04:00
committed by Ethan Buchman
parent 57ea4987f7
commit 331857c9e6
14 changed files with 147 additions and 49 deletions

View File

@ -225,11 +225,14 @@ func (cs *ConsensusState) OnStart() error {
}
// we need the timeoutRoutine for replay so
// we don't block on the tick chan.
// we don't block on the tick chan.
// NOTE: we will get a build up of garbage go routines
// firing on the tockChan until the receiveRoutine is started
// to deal with them (by that point, at most one will be valid)
cs.timeoutTicker.Start()
// firing on the tockChan until the receiveRoutine is started
// to deal with them (by that point, at most one will be valid)
_, err := cs.timeoutTicker.Start()
if err != nil {
return err
}
// we may have lost some votes if the process crashed
// reload from consensus log to catchup
@ -254,7 +257,10 @@ func (cs *ConsensusState) OnStart() error {
// timeoutRoutine: receive requests for timeouts on tickChan and fire timeouts on tockChan
// receiveRoutine: serializes processing of proposoals, block parts, votes; coordinates state transitions
func (cs *ConsensusState) startRoutines(maxSteps int) {
cs.timeoutTicker.Start()
_, err := cs.timeoutTicker.Start()
if err != nil {
panic(err)
}
go cs.receiveRoutine(maxSteps)
}
@ -338,12 +344,16 @@ func (cs *ConsensusState) AddProposalBlockPart(height, round int, part *types.Pa
// SetProposalAndBlock inputs the proposal and all block parts.
func (cs *ConsensusState) SetProposalAndBlock(proposal *types.Proposal, block *types.Block, parts *types.PartSet, peerKey string) error {
cs.SetProposal(proposal, peerKey)
if err := cs.SetProposal(proposal, peerKey); err != nil {
return err
}
for i := 0; i < parts.Total(); i++ {
part := parts.GetPart(i)
cs.AddProposalBlockPart(proposal.Height, proposal.Round, part, peerKey)
if err := cs.AddProposalBlockPart(proposal.Height, proposal.Round, part, peerKey); err != nil {
return err
}
}
return nil // TODO errors
return nil
}
//------------------------------------------------------------