mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
Add relay health check and tests
This commit is contained in:
@@ -40,6 +40,7 @@ from utils.password_prompt import (
|
||||
prompt_existing_password,
|
||||
confirm_action,
|
||||
)
|
||||
from constants import MIN_HEALTHY_RELAYS
|
||||
|
||||
from constants import (
|
||||
APP_DIR,
|
||||
@@ -763,6 +764,17 @@ class PasswordManager:
|
||||
parent_seed=getattr(self, "parent_seed", None),
|
||||
)
|
||||
|
||||
if hasattr(self.nostr_client, "check_relay_health"):
|
||||
healthy = self.nostr_client.check_relay_health(MIN_HEALTHY_RELAYS)
|
||||
if healthy < MIN_HEALTHY_RELAYS:
|
||||
print(
|
||||
colored(
|
||||
f"Only {healthy} relay(s) responded with your latest event."
|
||||
" Consider adding more relays via Settings.",
|
||||
"yellow",
|
||||
)
|
||||
)
|
||||
|
||||
logger.debug("Managers re-initialized for the new fingerprint.")
|
||||
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user