Explorar o código

raft: init lead to none

Xiang Li %!s(int64=11) %!d(string=hai) anos
pai
achega
bea28933d3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      raft/raft.go

+ 1 - 1
raft/raft.go

@@ -141,7 +141,7 @@ type stateMachine struct {
 }
 
 func newStateMachine(id int64, peers []int64) *stateMachine {
-	sm := &stateMachine{id: id, log: newLog(), ins: make(map[int64]*index)}
+	sm := &stateMachine{id: id, lead: none, log: newLog(), ins: make(map[int64]*index)}
 	for _, p := range peers {
 		sm.ins[p] = &index{}
 	}