Browse Source

raft: group Node fields

Blake Mizerany 11 years ago
parent
commit
3a85d97fd9
1 changed files with 3 additions and 5 deletions
  1. 3 5
      raft/node.go

+ 3 - 5
raft/node.go

@@ -18,13 +18,11 @@ type config struct {
 }
 
 type Node struct {
-	// election timeout and heartbeat timeout in tick
+	sm *stateMachine
+
+	elapsed   tick
 	election  tick
 	heartbeat tick
-
-	// elapsed ticks after the last reset
-	elapsed tick
-	sm      *stateMachine
 }
 
 func New(id int, heartbeat, election tick) *Node {