fix(gui): Monero regex issue, context initialize issue (#437)

Co-authored-by: Maksim Kirillov <artist@eduroam-141-23-183-184.wlan.tu-berlin.de>
This commit is contained in:
Matroskine 2025-06-25 11:13:22 +02:00 committed by GitHub
parent 38f2ddec77
commit cd4aa5201a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -230,10 +230,11 @@ export async function initializeContext() {
store.getState().settings.nodes[network][Blockchain.Monero][0] ?? null;
// Check the state of the Monero node
const isMoneroNodeOnline = await getMoneroNodeStatus(moneroNodeUrl, network);
const moneroNodeConfig =
useMoneroRpcPool || moneroNodeUrl == null || !isMoneroNodeOnline
useMoneroRpcPool ||
moneroNodeUrl == null ||
!(await getMoneroNodeStatus(moneroNodeUrl, network))
? { type: "Pool" as const }
: {
type: "SingleNode" as const,

View file

@ -17,8 +17,8 @@ export function piconerosToXmr(piconeros: number): number {
export function isXmrAddressValid(address: string, stagenet: boolean) {
const re = stagenet
? "^(5[0-9A-Za-z]{94}|5[0-9A-Za-z]{105})$"
: "^(?:[48][0-9A-Za-z]{94}|4[0-9A-Za-z]{105})$";
? "^(?:[57][0-9A-Za-z]{94}|[57][0-9A-Za-z]{105})$"
: "^(?:[48][0-9A-Za-z]{94}|[48][0-9A-Za-z]{105})$";
return new RegExp(`(?:^${re}$)`).test(address);
}