// processVoteCh initiates a blocking process where we listen for and handle
// envelopes on the VoteSetBitsChannel. Any error encountered during message
// execution will result in a PeerError being sent on the VoteSetBitsChannel.
// When the reactor is stopped, we will catch the signal and close the p2p
// Channel gracefully.
processVoteCh initiates a blocking process where we listen for and handle
envelopes on the VoteSetBitsChannel. Any error encountered during message
execution will result in a PeerError being sent on the VoteSetBitsChannel.
When the reactor is stopped, we will catch the signal and close the p2p
Channel gracefully.
// processVoteCh initiates a blocking process where we listen for and handle // envelopes on the VoteSetBitsChannel . Any error encountered during message // execution will result in a PeerError being sent on the VoteSetBitsChannel . // When the reactor is stopped we will catch the signal and close the p2p // Channel gracefully .
func (r *Reactor) processVoteSetBitsCh() {
	defer r.voteSetBitsCh.Close()
	for {
		select {
		case envelope := <-r.voteSetBitsCh.In:
			if err := r.handleMessage(r.voteSetBitsCh.ID, envelope); err != nil {
				r.Logger.Error("failed to process message", "ch_id", r.voteSetBitsCh.ID, "envelope", envelope, "err", err)
				r.voteSetBitsCh.Error <- p2p.PeerError{
					NodeID: envelope.From,
					Err:    err,
				}
			}
		case <-r.closeCh:
			r.Logger.Debug("stopped listening on VoteSetBitsChannel; closing...")
			return
		}
	}
}
func ( r * Reactor ) processVoteSetBitsCh ( ) { defer r . voteSetBitsCh . Close ( ) for { select { case envelope := <- r . voteSetBitsCh . In : if err := r . handleMessage ( r . voteSetBitsCh . ID , envelope ) ; err != nil { r . Logger . Error ( " " , " " , r . voteSetBitsCh . ID , " " , envelope , " " , err ) r . voteSetBitsCh . Error <- p2p . PeerError { NodeID : envelope . From , Err : err , } } case <- r . closeCh : r . Logger . Debug ( " " ) return } } }
processVoteCh initiates a blocking process where we listen for and handle
envelopes on the VoteSetBitsChannel.
processVoteCh initiates a blocking process where we listen for and handle envelopes on the VoteSetBitsChannel .