@@ -292,10 +292,7 @@ struct config {
292292};
293293....
294294
295- void app_configure_from_snapshot (raft_server_t * r,
296- struct config * head,
297- raft_term_t last_applied_term
298- raft_index_t last_applied_index)
295+ void app_configure_from_snapshot (raft_server_t * r, struct config * head)
299296{
300297 struct config * cfg = head;
301298
@@ -313,7 +310,14 @@ void app_configure_from_snapshot(raft_server_t *r,
313310 }
314311 cfg = cfg->next;
315312 }
316-
313+ }
314+
315+ void app_restore_snapshot(raft_server_t * r,
316+ struct config * head,
317+ raft_term_t last_applied_term
318+ raft_index_t last_applied_index)
319+ {
320+ app_configure_from_snapshot(r, head);
317321 raft_restore_snapshot(r, last_applied_term, last_applied_index);
318322}
319323
@@ -348,7 +352,8 @@ void app_restore_raft_library()
348352 // extracted node configuration list,
349353 // extracted last_applied_term and last_applied_index
350354 // See the example implementation above for this function.
351- app_configure_from_snapshot (r, cfg, last_applied_term, last_applied_index);
355+ app_configure_from_snapshot (r, cfg);
356+ raft_restore_snapshot(r, snapshot_last_term, snapshot_last_index);
352357
353358 app_load_logs_to_impl(); // Load log entries in your log implementation
354359 raft_restore_log();
0 commit comments