mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 12:11:44 +00:00
undo some megacheck suggestions
This commit is contained in:
@ -212,9 +212,9 @@ func (pool *BlockPool) AddBlock(peerID string, block *types.Block, blockSize int
|
||||
pool.numPending--
|
||||
peer := pool.peers[peerID]
|
||||
peer.decrPending(blockSize)
|
||||
} // else {
|
||||
// Bad peer?
|
||||
// }
|
||||
} else {
|
||||
// Bad peer?
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the peer's alleged blockchain height.
|
||||
@ -303,7 +303,7 @@ func (pool *BlockPool) sendTimeout(peerID string) {
|
||||
}
|
||||
|
||||
// unused by tendermint; left for debugging purposes
|
||||
/*func (pool *BlockPool) debug() string {
|
||||
func (pool *BlockPool) debug() string {
|
||||
pool.mtx.Lock() // Lock
|
||||
defer pool.mtx.Unlock()
|
||||
|
||||
@ -317,7 +317,7 @@ func (pool *BlockPool) sendTimeout(peerID string) {
|
||||
}
|
||||
}
|
||||
return str
|
||||
}*/
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
|
@ -132,8 +132,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte)
|
||||
|
||||
bcR.Logger.Debug("Receive", "src", src, "chID", chID, "msg", msg)
|
||||
|
||||
// [zr] note: the `megacheck` tool (go vet on steroids)
|
||||
// really dislikes the logic in this switch
|
||||
// TODO: improve logic to satisfy megacheck
|
||||
switch msg := msg.(type) {
|
||||
case *bcBlockRequestMessage:
|
||||
// Got a request for a block. Respond with block if we have it.
|
||||
|
@ -649,9 +649,9 @@ func (cs *ConsensusState) handleMsg(mi msgInfo, rs RoundState) {
|
||||
// attempt to add the vote and dupeout the validator if its a duplicate signature
|
||||
// if the vote gives us a 2/3-any or 2/3-one, we transition
|
||||
_ = cs.tryAddVote(msg.Vote, peerKey)
|
||||
//if err == ErrAddingVote {
|
||||
// TODO: punish peer
|
||||
//}
|
||||
if err == ErrAddingVote {
|
||||
// TODO: punish peer
|
||||
}
|
||||
|
||||
// NOTE: the vote is broadcast to peers by the reactor listening
|
||||
// for vote events
|
||||
@ -897,10 +897,10 @@ func (cs *ConsensusState) enterPrevote(height int, round int) {
|
||||
// fire event for how we got here
|
||||
if cs.isProposalComplete() {
|
||||
types.FireEventCompleteProposal(cs.evsw, cs.RoundStateEvent())
|
||||
} // else {
|
||||
// we received +2/3 prevotes for a future round
|
||||
// TODO: catchup event?
|
||||
//}
|
||||
} else {
|
||||
// we received +2/3 prevotes for a future round
|
||||
// TODO: catchup event?
|
||||
}
|
||||
|
||||
cs.Logger.Info(cmn.Fmt("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step))
|
||||
|
||||
@ -1122,9 +1122,9 @@ func (cs *ConsensusState) enterCommit(height int, commitRound int) {
|
||||
// Set up ProposalBlockParts and keep waiting.
|
||||
cs.ProposalBlock = nil
|
||||
cs.ProposalBlockParts = types.NewPartSetFromHeader(blockID.PartsHeader)
|
||||
} // else {
|
||||
// We just need to keep waiting.
|
||||
//}
|
||||
} else {
|
||||
// We just need to keep waiting.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -366,9 +366,9 @@ func (c *MConnection) sendMsgPacket() bool {
|
||||
// Nothing to send?
|
||||
if leastChannel == nil {
|
||||
return true
|
||||
} // else {
|
||||
// c.Logger.Info("Found a msgPacket to send")
|
||||
//}
|
||||
} else {
|
||||
// c.Logger.Info("Found a msgPacket to send")
|
||||
}
|
||||
|
||||
// Make & send a msgPacket from this channel
|
||||
n, err := leastChannel.writeMsgPacketTo(c.bufWriter)
|
||||
|
@ -157,7 +157,7 @@ func updateValidators(validators *types.ValidatorSet, changedValidators []*abci.
|
||||
|
||||
// return a bit array of validators that signed the last commit
|
||||
// NOTE: assumes commits have already been authenticated
|
||||
/*func commitBitArrayFromBlock(block *types.Block) *cmn.BitArray {
|
||||
func commitBitArrayFromBlock(block *types.Block) *cmn.BitArray {
|
||||
signed := cmn.NewBitArray(len(block.LastCommit.Precommits))
|
||||
for i, precommit := range block.LastCommit.Precommits {
|
||||
if precommit != nil {
|
||||
@ -165,7 +165,7 @@ func updateValidators(validators *types.ValidatorSet, changedValidators []*abci.
|
||||
}
|
||||
}
|
||||
return signed
|
||||
}*/
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
// Validate block
|
||||
|
Reference in New Issue
Block a user