docs: fix invalid reference in Raft README

Code snippet in Raft README refers to non-existent field `State`. Fixed
the reference by setting it to `HardState`.
release-3.4
Kostas Christidis 2018-01-17 15:55:53 -05:00
parent 30511860a6
commit 97fad42d81
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ The total state machine handling loop will look something like this:
case <-s.Ticker:
n.Tick()
case rd := <-s.Node.Ready():
saveToStorage(rd.State, rd.Entries, rd.Snapshot)
saveToStorage(rd.HardState, rd.Entries, rd.Snapshot)
send(rd.Messages)
if !raft.IsEmptySnap(rd.Snapshot) {
processSnapshot(rd.Snapshot)