diff --git a/core/src/main/java/haveno/core/account/witness/AccountAgeWitnessService.java b/core/src/main/java/haveno/core/account/witness/AccountAgeWitnessService.java index 27560f1576..a97a2b1b41 100644 --- a/core/src/main/java/haveno/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/haveno/core/account/witness/AccountAgeWitnessService.java @@ -771,7 +771,7 @@ public class AccountAgeWitnessService { boolean isFiltered = filterManager.isNodeAddressBanned(dispute.getContract().getBuyerNodeAddress()) || filterManager.isNodeAddressBanned(dispute.getContract().getSellerNodeAddress()) || filterManager.isCurrencyBanned(dispute.getContract().getOfferPayload().getCurrencyCode()) || - filterManager.isPaymentMethodBanned(PaymentMethod.getPaymentMethod(dispute.getContract().getPaymentMethodId())) || + filterManager.isPaymentMethodBanned(PaymentMethod.getPaymentMethodOrNA(dispute.getContract().getPaymentMethodId())) || filterManager.arePeersPaymentAccountDataBanned(dispute.getBuyerPaymentAccountPayload()) || filterManager.arePeersPaymentAccountDataBanned(dispute.getSellerPaymentAccountPayload()) || filterManager.isWitnessSignerPubKeyBanned(Utils.HEX.encode(dispute.getContract().getBuyerPubKeyRing().getSignaturePubKeyBytes())) || diff --git a/core/src/main/java/haveno/core/offer/Offer.java b/core/src/main/java/haveno/core/offer/Offer.java index 488ef3bdae..08a9e59197 100644 --- a/core/src/main/java/haveno/core/offer/Offer.java +++ b/core/src/main/java/haveno/core/offer/Offer.java @@ -318,7 +318,7 @@ public class Offer implements NetworkPayload, PersistablePayload { } public PaymentMethod getPaymentMethod() { - return PaymentMethod.getPaymentMethod(offerPayload.getPaymentMethodId()); + return PaymentMethod.getPaymentMethodOrNA(offerPayload.getPaymentMethodId()); } // utils diff --git a/core/src/main/java/haveno/core/payment/PaymentAccount.java b/core/src/main/java/haveno/core/payment/PaymentAccount.java index 9eee78b850..20076a98ed 100644 --- a/core/src/main/java/haveno/core/payment/PaymentAccount.java +++ b/core/src/main/java/haveno/core/payment/PaymentAccount.java @@ -169,7 +169,7 @@ public abstract class PaymentAccount implements PersistablePayload { ngnTwOptional.ifPresent(tradeCurrencies::remove); try { - PaymentAccount account = PaymentAccountFactory.getPaymentAccount(PaymentMethod.getPaymentMethod(paymentMethodId)); + PaymentAccount account = PaymentAccountFactory.getPaymentAccount(PaymentMethod.getPaymentMethodOrNA(paymentMethodId)); account.getTradeCurrencies().clear(); account.setId(proto.getId()); account.setCreationDate(proto.getCreationDate()); @@ -348,7 +348,7 @@ public abstract class PaymentAccount implements PersistablePayload { } private static Class getPaymentAccountClass(String paymentMethodId) { - PaymentMethod paymentMethod = PaymentMethod.getPaymentMethod(paymentMethodId); + PaymentMethod paymentMethod = PaymentMethod.getPaymentMethodOrNA(paymentMethodId); return PaymentAccountFactory.getPaymentAccount(paymentMethod).getClass(); } diff --git a/core/src/main/java/haveno/core/payment/payload/PaymentMethod.java b/core/src/main/java/haveno/core/payment/payload/PaymentMethod.java index 9444576d96..55dff62fdc 100644 --- a/core/src/main/java/haveno/core/payment/payload/PaymentMethod.java +++ b/core/src/main/java/haveno/core/payment/payload/PaymentMethod.java @@ -448,6 +448,11 @@ public final class PaymentMethod implements PersistablePayload, Comparable new IllegalArgumentException("Invalid payment method id: " + id)); + } + + public static PaymentMethod getPaymentMethodOrNA(String id) { return getActivePaymentMethod(id) .orElseGet(() -> new PaymentMethod(Res.get("shared.na"))); }