mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-26 05:26:45 +00:00
switch from paynym.is to paynym.rs and tor equivalents, update child wallet labels on displaying paynym dialog
This commit is contained in:
parent
1bbc586cd6
commit
e50fe4c68c
3 changed files with 14 additions and 5 deletions
|
@ -125,7 +125,7 @@ public class PayNymAvatar extends StackPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
try(InputStream is = (proxy == null ? new URI(url).toURL().openStream() : new URI(url).toURL().openConnection(proxy).getInputStream())) {
|
try(InputStream is = (proxy == null ? new URI(url).toURL().openStream() : new URI(url).toURL().openConnection(proxy).getInputStream())) {
|
||||||
Image image = new Image(is, 150, 150, true, false);
|
Image image = new Image(is, 150, 150, true, true);
|
||||||
paymentCodeCache.put(cacheId, image);
|
paymentCodeCache.put(cacheId, image);
|
||||||
Platform.runLater(() -> EventManager.get().post(new PayNymImageLoadedEvent(paymentCode, image)));
|
Platform.runLater(() -> EventManager.get().post(new PayNymImageLoadedEvent(paymentCode, image)));
|
||||||
return image;
|
return image;
|
||||||
|
|
|
@ -42,7 +42,8 @@ import static com.sparrowwallet.sparrow.wallet.PaymentController.MINIMUM_P2PKH_O
|
||||||
public class PayNymController {
|
public class PayNymController {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PayNymController.class);
|
private static final Logger log = LoggerFactory.getLogger(PayNymController.class);
|
||||||
|
|
||||||
public static final Pattern PAYNYM_REGEX = Pattern.compile("\\+[a-z]+[0-9][0-9a-fA-F][0-9a-fA-F]");
|
public static final Pattern SAMOURAI_PAYNYM_REGEX = Pattern.compile("\\+[a-z]+[0-9][0-9a-fA-F][0-9a-fA-F]");
|
||||||
|
public static final Pattern ASHIGARU_PAYNYM_REGEX = Pattern.compile("\\+[a-z]+[0-9][0-9]");
|
||||||
public static final String INVALID_PAYMENT_CODE_LABEL = "Invalid Payment Code";
|
public static final String INVALID_PAYMENT_CODE_LABEL = "Invalid Payment Code";
|
||||||
|
|
||||||
private String walletId;
|
private String walletId;
|
||||||
|
@ -127,7 +128,7 @@ public class PayNymController {
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
} else if(PAYNYM_REGEX.matcher(input).matches()) {
|
} else if(ASHIGARU_PAYNYM_REGEX.matcher(input).matches()) {
|
||||||
findNymProperty.set(input);
|
findNymProperty.set(input);
|
||||||
} else {
|
} else {
|
||||||
findNymProperty.set(null);
|
findNymProperty.set(null);
|
||||||
|
@ -343,7 +344,12 @@ public class PayNymController {
|
||||||
PaymentCode externalPaymentCode = childWallet.getKeystores().get(0).getExternalPaymentCode();
|
PaymentCode externalPaymentCode = childWallet.getKeystores().get(0).getExternalPaymentCode();
|
||||||
String walletNymName = PayNym.getNymName(childWallet);
|
String walletNymName = PayNym.getNymName(childWallet);
|
||||||
if(payNymMap.get(externalPaymentCode) == null || (walletNymName != null && !walletNymName.equals(payNymMap.get(externalPaymentCode).nymName()))) {
|
if(payNymMap.get(externalPaymentCode) == null || (walletNymName != null && !walletNymName.equals(payNymMap.get(externalPaymentCode).nymName()))) {
|
||||||
payNymMap.put(externalPaymentCode, PayNym.fromWallet(childWallet));
|
if(walletNymName != null && payNymMap.get(externalPaymentCode) != null && SAMOURAI_PAYNYM_REGEX.matcher(walletNymName).matches()) {
|
||||||
|
childWallet.setLabel(payNymMap.get(externalPaymentCode).nymName() + " " + childWallet.getScriptType().getName());
|
||||||
|
EventManager.get().post(new WalletLabelChangedEvent(childWallet));
|
||||||
|
} else {
|
||||||
|
payNymMap.put(externalPaymentCode, PayNym.fromWallet(childWallet));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,9 @@ public class PayNymService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getHostUrl(boolean tor) {
|
public static String getHostUrl(boolean tor) {
|
||||||
return tor ? "http://paynym7bwekdtb2hzgkpl6y2waqcrs2dii7lwincvxme7mdpcpxzfsad.onion" : "https://paynym.is";
|
//Samourai PayNym server
|
||||||
|
//return tor ? "http://paynym7bwekdtb2hzgkpl6y2waqcrs2dii7lwincvxme7mdpcpxzfsad.onion" : "https://paynym.is";
|
||||||
|
//Ashigaru PayNym server
|
||||||
|
return tor ? "http://paynym25chftmsywv4v2r67agbrr62lcxagsf4tymbzpeeucucy2ivad.onion" : "https://paynym.rs";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue