Browse Source

remove warning messages in favor of "Send failed"

pull/373/head
Anton Kaliaev 8 years ago
parent
commit
2c724d5eee
No known key found for this signature in database GPG Key ID: 7B6881D965918214
2 changed files with 3 additions and 18 deletions
  1. +0
    -1
      blockchain/reactor.go
  2. +3
    -17
      consensus/reactor.go

+ 0
- 1
blockchain/reactor.go View File

@ -118,7 +118,6 @@ func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
// AddPeer implements Reactor by sending our state to peer.
func (bcR *BlockchainReactor) AddPeer(peer *p2p.Peer) {
if !peer.Send(BlockchainChannel, struct{ BlockchainMessage }{&bcStatusResponseMessage{bcR.store.Height()}}) {
log.Warn("Failed to send our state to peer", "peer", peer)
// doing nothing, will try later in `poolRoutine`
}
}


+ 3
- 17
consensus/reactor.go View File

@ -365,19 +365,13 @@ func makeRoundStepMessages(rs *RoundState) (nrsMsg *NewRoundStepMessage, csMsg *
}
func (conR *ConsensusReactor) sendNewRoundStepMessages(peer *p2p.Peer) {
log := log.New("peer", peer)
rs := conR.conS.GetRoundState()
nrsMsg, csMsg := makeRoundStepMessages(rs)
if nrsMsg != nil {
if !peer.Send(StateChannel, struct{ ConsensusMessage }{nrsMsg}) {
log.Warn("Failed to send NewRoundStepMessage to peer")
}
peer.Send(StateChannel, struct{ ConsensusMessage }{nrsMsg})
}
if csMsg != nil {
if !peer.Send(StateChannel, struct{ ConsensusMessage }{csMsg}) {
log.Warn("Failed to send RoundStepCommit to peer")
}
peer.Send(StateChannel, struct{ ConsensusMessage }{csMsg})
}
}
@ -406,8 +400,6 @@ OUTER_LOOP:
}
if peer.Send(DataChannel, struct{ ConsensusMessage }{msg}) {
ps.SetHasProposalBlockPart(prs.Height, prs.Round, index)
} else {
log.Warn("Failed to send BlockPartMessage to peer")
}
continue OUTER_LOOP
}
@ -445,8 +437,6 @@ OUTER_LOOP:
}
if peer.Send(DataChannel, struct{ ConsensusMessage }{msg}) {
ps.SetHasProposalBlockPart(prs.Height, prs.Round, index)
} else {
log.Warn("Failed to send BlockPartMessage to peer")
}
continue OUTER_LOOP
} else {
@ -475,8 +465,6 @@ OUTER_LOOP:
msg := &ProposalMessage{Proposal: rs.Proposal}
if peer.Send(DataChannel, struct{ ConsensusMessage }{msg}) {
ps.SetHasProposal(rs.Proposal)
} else {
log.Warn("Failed to send ProposalMessage to peer")
}
}
// ProposalPOL: lets peer know which POL votes we have so far.
@ -489,9 +477,7 @@ OUTER_LOOP:
ProposalPOLRound: rs.Proposal.POLRound,
ProposalPOL: rs.Votes.Prevotes(rs.Proposal.POLRound).BitArray(),
}
if !peer.Send(DataChannel, struct{ ConsensusMessage }{msg}) {
log.Warn("Failed to send ProposalPOLMessage to peer")
}
peer.Send(DataChannel, struct{ ConsensusMessage }{msg})
}
continue OUTER_LOOP
}


Loading…
Cancel
Save