fix(app): validate contact addresses when saving

Adding a contact now checks the address against the wallet's network and
rejects duplicates; whitespace in a pasted address is removed. Before, any
string was stored and the error only surfaced at send time.
This commit is contained in:
davide committed 2026-11-03 14:15:03 +01:00
1 parent 06d1f59c2b
commit eca4d4ac0c
5 files changed
+117 -5

No files matched your search

+5 -3
View File
@@ -508,9 +508,11 @@ them is normal.
A simple per-wallet address book, on its own tab:
- **Add**: name + address, both required (whitespace is trimmed). Note: the address format
is **not validated when saving** — it is only validated when you actually send to it. Copy
addresses carefully.
- **Add**: name + address, both required. The address is **validated when saving** against
the wallet's network: an invalid or wrong-network address, or one already in the list, is
refused with a message. Spaces and line breaks in a pasted address are removed. Contacts
saved by an older version without validation are still shown; the send form validates the
destination again when you use them.
- **Remove selected**: deletes the highlighted contact. There is no edit function — remove
and re-add.
- Contacts are used by the **From contacts** dropdown on the Send tab.