Skip to content

Commit

Permalink
Fix registration without force (whisperfish#192)
Browse files Browse the repository at this point in the history
In the presage-store-sled implementation, `load_state` always returns
`Ok(_)` (except for errors). Therefore, the registration condition that
determines if the store was already registered, `!force &&
config_store.load_state.is_ok()` is always `true` when `force == false`.
Instead, one should use `config_store.is_registered()` to figure out if
the store is already registered.
  • Loading branch information
Schmiddiii authored Sep 29, 2023
1 parent 1e84c13 commit e3a6084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion presage/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<C: Store> Manager<C, Registration> {
} = registration_options;

// check if we are already registered
if !force && config_store.load_state().is_ok() {
if !force && config_store.is_registered() {
return Err(Error::AlreadyRegisteredError);
}

Expand Down

0 comments on commit e3a6084

Please sign in to comment.