fix(ui): validate shielded addresses with the correct RPC

The Validate address dialog chose its RPC from the first character of
the input, then asked the transparent-only validateaddress for every
case. That RPC is Base58-only, so a valid Sapling (z) address came back
isvalid=false and was reported invalid.

- The input is now classified with the checksum-verified recognizers,
  and a shielded address is sent to z_validateaddress while a
  transparent (mining) address keeps validateaddress.
- Anything that is not an address - a typo, garbage, or a pasted
  viewing/spending key - is judged invalid on the spot and never sent to
  the node, so a key pasted into the field is not leaked to an RPC.
- On Lite there is no node to ask, so the dialog shows the checksum
  verdict alone and hides the "owned by this wallet" row.

Tests: validateRpcMethod maps shielded to z_validateaddress, transparent
to validateaddress, and a key or empty string to no RPC.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 21:42:23 -05:00
co-authored by Claude Opus 4.8
parent abc82136c4
commit 579accd0c6
5 changed files with 88 additions and 64 deletions
+1
View File
@@ -51,6 +51,7 @@ private:
static bool s_is_valid;
static bool s_is_mine;
static bool s_is_mining; // a valid transparent (mining) address: explain it can't be paid
static bool s_ownership_known; // false when no node was asked (lite): the ownership row is hidden
static std::string s_address_type;
static std::string s_error_message;
};