raft: correct hasLeader

This commit is contained in:
Blake Mizerany 2014-08-23 17:31:01 -07:00 committed by Yicheng Qin
parent 72c65e74f5
commit 75dce35a5d

View File

@ -162,7 +162,7 @@ func newRaft(id int64, peers []int64) *raft {
return r
}
func (r *raft) hasLeader() bool { return r.state != stateCandidate }
func (r *raft) hasLeader() bool { return r.lead != none }
func (r *raft) propose(data []byte) {
r.Step(Message{From: r.id, Type: msgProp, Entries: []Entry{{Data: data}}})