Commit ce87fa4e authored by djq2's avatar djq2
Browse files

Close version

parent 6f9047eb
......@@ -272,11 +272,11 @@ func (rf *Raft) Follower() {
func (rf *Raft) Candidate() {
timeout := time.Duration((750 + (rand.Int() % 150))) * time.Millisecond
fmt.Println(strconv.Itoa(rf.me) + "Initiated Election")
// fmt.Println(rf)
fmt.Println()
if rf.votedFor.term >= rf.currentTerm + 1{
go rf.Follower()
return
}
......@@ -285,6 +285,8 @@ func (rf *Raft) Candidate() {
rf.state = "CANDIDATE"
rf.mu.Unlock()
fmt.Println(strconv.Itoa(rf.me) + "Initiated Election")
candStart := time.Now()
majority := len(rf.peers)/2
//set up vote args
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment