mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-24 14:15:55 -04:00
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:
parent
38f2ddec77
commit
cd4aa5201a
2 changed files with 5 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue