From e3a6084cb573ab9eaccdd8b6c8994bd26862b058 Mon Sep 17 00:00:00 2001 From: Schmiddiii Date: Fri, 29 Sep 2023 14:24:35 +0200 Subject: [PATCH] Fix registration without force (#192) 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. --- presage/src/manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/presage/src/manager.rs b/presage/src/manager.rs index 6755c4f88..f9d1584af 100644 --- a/presage/src/manager.rs +++ b/presage/src/manager.rs @@ -188,7 +188,7 @@ impl Manager { } = 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); }